// headers
// ---------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "window.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
////////////////////////////////////////////////////////////////////////
// Common code for localtime and gmtime (static)
////////////////////////////////////////////////////////////////////////
-static struct tm * __cdecl common_localtime(const time_t * WXUNUSED(t), BOOL bLocal)
+
+static struct tm * __cdecl common_localtime(const time_t *t, BOOL bLocal)
{
+ wxLongLong i64;
+ FILETIME ft;
wxString str ;
SYSTEMTIME SystemTime;
TIME_ZONE_INFORMATION pTz;
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
};
- ::GetLocalTime(&SystemTime) ;
+ if (!*t)
+ ::GetLocalTime(&SystemTime);
+ else
+ {
+ i64 = *t;
+ i64 = i64 * 10000000 + 116444736000000000;
+
+ ft.dwLowDateTime = i64.GetLo();
+ ft.dwHighDateTime = i64.GetHi();
+
+ ::FileTimeToSystemTime(&ft, &SystemTime);
+ }
+
::GetTimeZoneInformation(&pTz);
///////////////////////////////////////////////
return res;
}
+extern "C"
+{
+
////////////////////////////////////////////////////////////////////////
// Receive the number of seconds elapsed since midnight(00:00:00)
// and convert a time value and corrects for the local time zone
return common_localtime(t, DO_GMTIME) ;
}
+}
////////////////////////////////////////////////////////////////////////
// Common code for conversion of struct tm into time_t (static)
return prog ;
}
+extern "C"
+{
////////////////////////////////////////////////////////////////////////
// Returns the number of seconds elapsed since
return 0;
}
+
+} // extern "C"