Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2014-06

StrToDateTime and ShortDateFormat = 'd. M. yyyy'

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Petr Kristan

Hi

In our country in Windows 8 is preset default short date format "d. M. rrrr"

In fpc:
DefaultFormatSettings.ShortDateFormat is set to 'd. M. yyyy' DefaultFormatSettings.DateSeparator = '.'

StrToDateTime('1. 1. 2000 12:00') has problem because func SplitDateTimeStr scans input string forward to find WhiteSpace.

I Delphi7 StrToDateTime works correctly.

After short look at rtl code I do not see any solution with SplitDateTimeStr. I think that correct solution is to first try parse date without splitting and then parse remaining optional time.

I can try to do that, but are there any StrToDateTime tests? I do not want to break what is working until now.

Petr

Petr Kristan . EPOS PRO s.r.o., Smilova 333, 530 02 Pardubice tel: +420 461101401 Czech Republic (Eastern Europe) fax: +420 461101481

Reply by email