]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/time.cpp
test for timegm() added
[wxWidgets.git] / src / common / time.cpp
index 71ad2fac3a5517789a6b7121db1063c89dd30d2c..1e358e4a09c2c1cee39b4e75db838071e4014b3e 100644 (file)
@@ -34,12 +34,13 @@ seconds since January 1, 1901, GMT.
 #include "wx/utils.h"
 #include "wx/intl.h"
 
-#include "wx/ioswrap.h"
-
-#if wxUSE_IOSTREAMH
-    #include <iomanip.h>
-#else
-    #include <iomanip>
+#if wxUSE_STD_IOSTREAM
+    #include "wx/ioswrap.h"
+    #if wxUSE_IOSTREAMH
+        #include <iomanip.h>
+    #else
+        #include <iomanip>
+    #endif
 #endif
 
 #include <string.h>
@@ -319,7 +320,7 @@ wxTime wxTime::Min(const wxTime& t) const
 }
 
 #ifndef __SALFORDC__
-wxTime::operator char *(void)
+wxTime::operator wxChar *(void)
 {
   return FormatTime();
 }
@@ -332,8 +333,8 @@ void wxTime::SetFormat(const wxTime::tFormat lFormat,
   wxTime::Precision  = lPrecision;
 }
 
-char *wxTime::FormatTime() const {
-  static char  timeBuf[30];
+wxChar *wxTime::FormatTime() const {
+  static wxChar  timeBuf[30];
   unsigned    hh(GetHour());
 
   switch (Format) {
@@ -346,18 +347,18 @@ char *wxTime::FormatTime() const {
 
   switch (Precision) {
   case wxStdMinSec:
-    sprintf(timeBuf,"%2d:%02d:%02d",hh,GetMinute(),GetSecond());
+    wxSprintf(timeBuf,wxT("%2d:%02d:%02d"),hh,GetMinute(),GetSecond());
     break;
   case wxStdMin:
-    sprintf(timeBuf,"%2d:%02d",hh,GetMinute());
+    wxSprintf(timeBuf,wxT("%2d:%02d"),hh,GetMinute());
     break;
   }
 
   if (Format == wx12h)
     if (GetHour() <= 12)
-      strcat(timeBuf,_("am"));
+      wxStrcat(timeBuf,_("am"));
     else
-      strcat(timeBuf,_("pm"));
+      wxStrcat(timeBuf,_("pm"));
 
   return timeBuf;
 }