#1 2016-04-19 00:18:14

igors233
Member
Registered: 2012-09-10
Posts: 234

Incorrect date time format

I'm using TSQLTableToGrid to display data from table and one of fields is TDateTime, issue I have that it's using incorrect datetime format for such conversion.
For example, I'm in Serbia but mORMot uses Croatian date format (end result are wrong month names).

I was able to reproduce problem on several computers, and was able to track it down to mORMoti18n.SetCurrentLanguage to
  "3. reset all Locale settings + AnsiCompare*() functions" code block, it seems that TLanguage.Fill, sets wrong details for LCID but I don't know why, aLanguage param is correct (lngSerbian), code page is also good (1250), Charset also (238), it must be something in LanguageToLCID.

In regional settings, Language for non unicode programs is set to Serbian (Latin) and Format settings are set to Serbian (Cyrillic).

Offline

#2 2016-04-19 06:03:47

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: Incorrect date time format

Try to set the CustomFormat[] value for the given column.
You could set the format used to display the date as text.

Offline

#3 2016-04-19 11:11:56

igors233
Member
Registered: 2012-09-10
Posts: 234

Re: Incorrect date time format

> Try to set the CustomFormat[] value for the given column.
> You could set the format used to display the date as text.

Thanks, I forgot to mention in post that I know of CustomFormat and that I've solved it that way, I was just reporting wrong behaviour and possibly some bug.

Offline

Board footer

Powered by FluxBB