wxDateTime::Format()

162 views
Skip to first unread message

teemo10

unread,
Jun 6, 2010, 12:07:34 PM6/6/10
to wx-users
The string returned by wxDateTime::Format() is exactly right for me. I
would simply like the seconds (and milliseconds, which by default
isn't displayed) to not be displayed in the string. What format would
i use to achieve that?

Vadim Zeitlin

unread,
Jun 6, 2010, 1:05:34 PM6/6/10
to wx-u...@googlegroups.com
On Sun, 6 Jun 2010 09:07:34 -0700 (PDT) teemo10 <tee...@gmail.com> wrote:

t> The string returned by wxDateTime::Format() is exactly right for me. I
t> would simply like the seconds (and milliseconds, which by default
t> isn't displayed) to not be displayed in the string. What format would
t> i use to achieve that?

Either "%x %H:%M" or "%x %I:%M %p". There is no way to get the "time
without the seconds in the current locale" AFAIK.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Fabian Cenedese

unread,
Jun 7, 2010, 3:03:12 AM6/7/10
to wx-u...@googlegroups.com
At 19:05 06.06.2010 +0200, Vadim Zeitlin wrote:
>On Sun, 6 Jun 2010 09:07:34 -0700 (PDT) teemo10 <tee...@gmail.com> wrote:
>
>t> The string returned by wxDateTime::Format() is exactly right for me. I
>t> would simply like the seconds (and milliseconds, which by default
>t> isn't displayed) to not be displayed in the string. What format would
>t> i use to achieve that?
>
> Either "%x %H:%M" or "%x %I:%M %p". There is no way to get the "time
>without the seconds in the current locale" AFAIK.

Or you just use the standard wxDateTime::Format() and then cut off the
seconds, provided the returned string looks always the same.

bye Fabi

Tamer El Nashar

unread,
Jun 7, 2010, 4:55:17 PM6/7/10
to wx-u...@googlegroups.com

Thanks for your assistance.

So i used "%x %I:%M %p", which works fine for what i need it for. However times such a 1:30 PM are always displayed as 01:30 PM, how can i tell it to get rid of the 0?
Reply all
Reply to author
Forward
0 new messages