Archived

This forum has been archived. Please start a new discussion on GitHub.

toDateTime() has year 3000 bug

I found it funny to notice that the string returned by toDateTime() utility uses two digits for the year (e.g.: today is represented as: "04/02/12"). I did not check but I think it also ignores the locale settings (e.g.: I could like better to have it as "02/04/2012").

All this makes the function not as general as I would like.

Comments

  • benoit
    benoit Rennes, France
    Hi,

    It's implemented using the strftime() C function with the "%x %H:%M:%S" format string, %x is replaced with local representation of the date.

    Cheers,
    Benoit.
  • Thanks!
    benoit wrote: »
    Hi,

    It's implemented using the strftime() C function with the "%x %H:%M:%S" format string, %x is replaced with local representation of the date.

    Cheers,
    Benoit.

    That was really useful. Now I know hot to get proper format out of toDateTime().


    Thanks,
    l.f.