mosml icon indicating copy to clipboard operation
mosml copied to clipboard

Date does not handle time zones correctly

Open kfl opened this issue 15 years ago • 3 comments

The implementation of Date does not handle time zones correctly in all cases. Example:

- Date.fmt "%H:%M %Z" (Date.fromTimeUniv (Time.now()));
> val it = "15:20 CET" : string

I believe CET ought to be GMT or UTC.

kfl avatar Jun 10 '10 15:06 kfl

Another example (executed in a non-UTC time-zone):

- Date.offset(Date.fromTimeLocal(Time.now()));
> val it = NONE : time option

kfl avatar Jun 10 '10 15:06 kfl

I believe this is correct, though weird. NONE represents the local time-zone, as per http://mlton.org/basis/date.html

mn200 avatar Jun 16 '10 11:06 mn200

Ah, yes you are right. But the original example still stand as an example of something wrong.

kfl avatar Jun 16 '10 12:06 kfl