Home » U++ Library support » CalendarCtrl » DataTimeCtrl and format dd/mm/yyyy
|
Re: DataTimeCtrl and format dd/mm/yyyy [message #9257 is a reply to message #9233] |
Tue, 24 April 2007 11:37 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
See Core/TimeDate.cpp. It looks like these should change the format for every date/string conversion:
void SetDateFormat(const char *fmt);
Sets the format for date to string conversions (default: "%2:02d/%3:02d/%1:4d") and
void SetDateScan(const char *scan);
Sets the format expected when doing string-date conversions (default: "mdy").
James
[Updated on: Tue, 24 April 2007 11:39] Report message to a moderator
|
|
|
|
Re: DataTimeCtrl and format dd/mm/yyyy [message #9266 is a reply to message #9264] |
Tue, 24 April 2007 19:16 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Works perfectly for me.
Bear in mind that if you call SetDateFormat/Scan after you have entered a date into the Ctrl you won't see it change because it's stored internally as a WString. But if you change formats and then reopen the Calendar pop-up you can see that it has swapped formats correctly.
If you want the change the date format after dates have been entered you need to make sure the data gets parsed correctly:
SetDateFormat("%3:02d/%2:02d/%1:4d");
// Read using old format, then set using new format
date_field.SetData( date_field.GetData() );
SetDateScan("dmy");
James.
[Updated on: Tue, 24 April 2007 20:01] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon Apr 29 08:30:55 CEST 2024
Total time taken to generate the page: 0.02093 seconds
|