wxDateTime Format Characters?

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Locked
dumb_aussie
In need of some credit
In need of some credit
Posts: 4
Joined: Mon May 12, 2008 11:16 pm
Location: Australia

wxDateTime Format Characters?

Post by dumb_aussie » Mon May 12, 2008 11:29 pm

Hi,

Anybody know where I can find a list of time format characters? They don't appear to be in the class references.

Im particularly interested in collecting AM/PM time and the full date eg 10:35 AM 13/05/2008 ?

Id prefer to do it with Format so I can collect for various timezones.

Eg.

wxDateTime time = wxDateTime::Now();
TString time_local, time_local_day, time_local_date;

time_local = time.Format(wxT("%T"), wxDateTime::A_EST).c_str();
time_local_day = time.Format(wxT("%A"),wxDateTime::A_EST).c_str();

time_local_date = time.Format(wxT("%x"), wxDateTime::A_EST).c_str();

Thanks in Advance
Brendan :wink:

timg
Earned some good credits
Earned some good credits
Posts: 148
Joined: Mon Jan 23, 2006 6:52 pm

Post by timg » Tue May 13, 2008 1:13 am


dumb_aussie
In need of some credit
In need of some credit
Posts: 4
Joined: Mon May 12, 2008 11:16 pm
Location: Australia

Post by dumb_aussie » Tue May 13, 2008 1:43 am

Yes that site had it

Thankyou

TIME FORMAT CHARACTERS:
%a Abbreviated weekday name eg. Thu
%A Full weekday name eg. Thursday
%b Abbreviated month name eg. Aug
%B Full month name eg. August
%c Date and time representation eg. Thu Aug 23 14:55:02 2001
%d Day of the month (01-31) eg. 23
%H Hour in 24h format (00-23) eg. 14
%I Hour in 12h format (01-12) eg. 02
%j Day of the year (001-366) eg. 235
%m Month as a decimal number (01-12) eg. 08
%M Minute (00-59) eg. 55
%p AM or PM designation eg. PM
%S Second (00-61) eg. 02
%U Week number with the first Sunday as the first day of week one (00-53) eg. 33
%w Weekday as a decimal number with Sunday as 0 (0-6) eg. 4
%W Week number with the first Monday as the first day of week one (00-53) eg. 34
%x Date representation eg. 08/23/01
%X Time representation eg. 14:55:02
%y Year, last two digits (00-99) eg. 01
%Y Year eg. 2001
%Z Timezone name or abbreviation CDT
%% A % sign eg. %

Locked