[wxMac] wxDateTime question

Vadim Zeitlin vadim at wxwidgets.org
Mon Jun 4 09:57:06 PDT 2007


On Mon, 04 Jun 2007 18:28:31 +0200 H <H at h.com> wrote:

H> > % cat dt.cpp
H> > #include "wx/init.h"
H> > #include "wx/wxchar.h"
H> > #include "wx/string.h"
H> > #include "wx/datetime.h"
H> > 
H> > int main()
H> > {
H> >     wxInitializer init;
H> >     if ( !init.IsOk() ) {
H> >         printf("Failed to initialize wxWidgets.\n");
H> >         return 1;
H> >     }
H> > 
H> >     wxDateTime dt = wxDateTime::Now();
H> >     wxPrintf(_T("Current time:\t%s\n"), dt.Format().c_str());
H> >     wxDateTime dtPST = dt.ToTimezone(wxDateTime::PST);
H> >     wxPrintf(_T("And in PST:\t%s\n"), dtPST.Format().c_str());
H> >     wxPrintf(_T("The difference:\t%s\n"), (dt - dtPST).Format().c_str());
H> > 
H> >     return 0;
H> > }
...
H> that's the result:
H> 
H> Current time: Mon Jun  4 18:22:27 2007
H> And in PST: Mon Jun  4 17:22:27 2007
H> The difference: 01:00:00

 For MESZ (a.k.a. CEST, or Central European Summer Time) this definitely
doesn't look right. Do you build using Xcode or command line tools? If it's
latter I'll try to debug it myself but if it's the former I'd be really
grateful if someone else could do it instead, I hate using Xcode and it's
dog slow on my Mac Mini.

 Thanks,
VZ

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





More information about the wx-users mailing list