xlcalculator icon indicating copy to clipboard operation
xlcalculator copied to clipboard

date format localization and supporting function DATEVALUE

Open bradbase opened this issue 4 years ago • 2 comments

Attempting to support function DATEVALUE and am having difficulty getting xlcalculator to correctly evaluate a result compared to a pre-created Excel workbook. The workbook archive was most recently calculated with DMY and (by default) python datetime parser uses MDY. I'm trying to find a deterministic way to get them to align (without evaluating the entire workbook looking for a parse error only to evaluate the entire workbook again -- which isn't certain to solve the problem anyway).

My Excel appears to be using date format DMY.

MS Help is using MDY.

I can configure a Python date parser to parse one or the other but I can't find a way to determine what the date format localization was when the workbook archive was created or most recently calculated.

We might need to define a settings file to give xlcalculator hints on localization. But still... need to be able to find out which one to use.

bradbase avatar Nov 16 '20 08:11 bradbase

note to @bradbase

onsider this in the approach. https://github.com/bradbase/xlcalculator/pull/29#issuecomment-731575344

bradbase avatar Nov 21 '20 22:11 bradbase

@bradbase So I know for sure that office honors the locale set on your computer. So we could pass a locale parameter tp make a decision how to parse the date.

But we should also check whether the workbook somewhere contains locale info.

strichter avatar May 27 '21 01:05 strichter