Get locale month name

3 posts / 0 new
Last post
mritter0
mritter0's picture
Offline
Last seen: 1 year 10 months ago
Joined: 2014-04-21 21:15
Get locale month name

Is there an easy way, without providing a dateStamp for FormatDate(), to get the Locale month names?

FormatDate(Locale,"%B",NULL,&putCharHook);
gives me January.

strcpy(CurrentMonth,Locale->MonthNames[11]);

to get November (or 10 if starting at 0) in current user's language.

Same for weekday names.

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 3 days ago
Joined: 2013-05-30 00:53
Try this (copy&paste from

Try this (copy&paste from DateTime.docky sources), you need to open LocaleBase/ILocale:

  1. ..
  2. int32 res_value;
  3. struct Locale *ll = ILocale->OpenLocale(NULL);
  4.  
  5. // Create localized month names
  6. for(res_value = 0; res_value < 12; res_value++)
  7. IDOS->PutStr( ILocale->GetLocaleStr(ll, MON_1+res_value) );
  8. ..

for weekdays maybe change to use 'DAY_1', not in front of my miggy now.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

mritter0
mritter0's picture
Offline
Last seen: 1 year 10 months ago
Joined: 2014-04-21 21:15
Excellent. That was what I

Excellent. That was what I needed. Thanks.

Log in or register to post comments