How to set date time format |
Post Reply |
Author | |
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
Posted: 31 May 2008 at 8:24pm |
Hi
I can see that the report control uses a CXTPReportControlLocale object to set date time formats for CXTPReportRecordItemDateTime items
But how can I change the date time format itself?
Why no SetDateTimeFormat(LPCSTR strFormat) function?
It's not using the system or user locale formats. Neither long nor short date nor time. At least it's not showing the format I see in Control Panel->Regional Settings.
So I can only assume it's using a hard-coded format string?
It's very confusing, and documentation is very sparse on this topic.
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
I just found it uses m_strFormatString....
which is set in CXTPReportRecordItem::SetFormatString
but this isn't mentioned anywhere in the docs.
Also, since it's a member string, how do I set it to NULL? It needs to be NULL to use locale settings...
|
|
cpede
Senior Member Joined: 13 August 2004 Location: Denmark Status: Offline Points: 668 |
Post Options
Thanks(0)
|
I think a suggestion would be to overwrite the SetFormatString (in this case a bad name) to use the OleDateTime formatting like: LANG_USER_DEFAULT and DATEVALUEONLY etc..
Most often users would prefer the local settings of Windows (?). And for some reason it is rather complex to convert the OleDateTime formatting strings to the Windows Date Time formatting strings and vise versa.
Another way is to use the %x and %X formatting, and then maybe play around with the setlocale(LC_ALL,"").
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |