strftime()-like formating

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.
Post Reply
viraptor
Knows some wx things
Knows some wx things
Posts: 31
Joined: Sat Jan 08, 2005 3:37 pm

strftime()-like formating

Post by viraptor » Sun Mar 20, 2005 8:01 pm

wxDateTime->Format(wxChar format*) does strftime() formating, but it doesn't support gnu extensions... that makes it unusable on many occasions.

Some of gnu extensions for formating in strftime() i'm talking about are:
- - no padding,
_ - blank padding,
0 - 0 padding
^ - uppercasing

I think it should be included in wxWidgets. Your opinion?

It's hard to do wxString::Format("%d.%02d.%d", date->Get.....
date->Format("%-d.%0m.%C%y") would be better.

User avatar
Ryan Norton
Moderator
Moderator
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Re: strftime()-like formating

Post by Ryan Norton » Mon Mar 21, 2005 8:55 am

viraptor wrote:wxDateTime->Format(wxChar format*) does strftime() formating, but it doesn't support gnu extensions... that makes it unusable on many occasions.

Some of gnu extensions for formating in strftime() i'm talking about are:
- - no padding,
_ - blank padding,
0 - 0 padding
^ - uppercasing

I think it should be included in wxWidgets. Your opinion?

It's hard to do wxString::Format("%d.%02d.%d", date->Get.....
date->Format("%-d.%0m.%C%y") would be better.
wxWidgets uses the native strftime call (or should - if not its a bug :)) - so if your compiler's c lib supports it then wxDateTime::Format will also. Likewise, if your compiler does not support the GNU extentions in strftime then wxDateTime will not support it either.
[Mostly retired moderator, still check in to clean up some stuff]

viraptor
Knows some wx things
Knows some wx things
Posts: 31
Joined: Sat Jan 08, 2005 3:37 pm

Post by viraptor » Wed Mar 23, 2005 8:41 pm

I'm using official MSW build :(. Maybe it should be compiled on gnu extensions enabled environment next time? ;)

Post Reply