Print Page | Close Window

How to set date time format

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=10856
Printed Date: 16 November 2024 at 5:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to set date time format
Posted By: adrien
Subject: How to set date time format
Date 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.


-------------
http://www.wingate.com - http://www.wingate.com



Replies:
Posted By: adrien
Date Posted: 31 May 2008 at 8:26pm
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...


-------------
http://www.wingate.com - http://www.wingate.com


Posted By: cpede
Date Posted: 07 July 2008 at 2:14am
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,"").



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net