// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
+// TODO: for $DEITY sake, someone please fix the #ifdef __WXWINCE__ everywhere,
+// the proper way to do it is to implement (subset of) wxStrftime() for
+// CE instead of this horror!!
+
/*
* Implementation notes:
*
#ifdef __WINDOWS__
#include "wx/msw/wrapwin.h"
#include <winnls.h>
- #include <locale.h>
+ #ifndef __WXWINCE__
+ #include <locale.h>
+ #endif
#endif
#include "wx/datetime.h"
- JDN_OFFSET;
}
+#ifndef __WXWINCE__
// this function is a wrapper around strftime(3) adding error checking
static wxString CallStrftime(const wxChar *format, const tm* tm)
{
return wxString(buf);
}
+#endif
#ifdef HAVE_STRPTIME
jdn *= MILLISECONDS_PER_DAY;
+ m_time.Assign(jdn);
+
// JDNs always suppose an UTC date, so bring it back to local time zone
// (also see GetJulianDayNumber() implementation)
long tzDiff = GetTimeZone();
tzDiff -= 3600;
}
- jdn += tzDiff*1000; // tzDiff is in seconds
-
- m_time.Assign(jdn);
+ m_time += tzDiff*1000; // tzDiff is in seconds
return *this;
}
}
#ifdef __WINDOWS__
+
// Get's current locale's date formatting string and stores it in fmt if
// the locale is set; otherwise or in case of failure, leaves fmt unchanged
-void GetLocaleDateFormat(wxString *fmt)
+static void GetLocaleDateFormat(wxString *fmt)
{
+ // there is no setlocale() under Windows CE, so just always query the
+ // system there
+#ifndef __WXWINCE__
if ( strcmp(setlocale(LC_ALL, NULL), "C") != 0 )
+#endif
{
// The locale was programatically set to non-C. We assume that this was
// done using wxLocale, in which case thread's current locale is also
// try our luck with the default set above
}
}
+
#endif // __WINDOWS__
const wxChar *wxDateTime::ParseFormat(const wxChar *date,