]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/time.cpp
Introduced wxSOCKET_INT to socket.cpp. The previous code wouldn't compile on Windows.
[wxWidgets.git] / src / common / time.cpp
index 15936ad32376b275c7ebdea4d34333f885de7e20..c8a19d63956aab43eedf9b606f14edb1c8b5a914 100644 (file)
@@ -27,19 +27,24 @@ seconds since January 1, 1901, GMT.
 
 #include "wx/setup.h"
 
 
 #include "wx/setup.h"
 
-#if USE_TIMEDATE
+#if wxUSE_TIMEDATE
 
 #include "wx/time.h"
 #include "wx/date.h"
 #include "wx/utils.h"
 
 #include "wx/time.h"
 #include "wx/date.h"
 #include "wx/utils.h"
+#include <wx/intl.h>
 
 
-#if USE_IOSTREAMH
+#if wxUSE_IOSTREAMH
 #include <iostream.h>
 #include <iostream.h>
+#include <iomanip.h>
 #else
 #include <iostream>
 #else
 #include <iostream>
+#include <iomanip>
+#  ifdef _MSC_VER
+      using namespace std;
+#  endif
 #endif
 
 #endif
 
-#include <iomanip.h>
 #include <string.h>
 
 #if !USE_SHARED_LIBRARY
 #include <string.h>
 
 #if !USE_SHARED_LIBRARY
@@ -141,7 +146,7 @@ wxTime::wxTime(const wxDate& date, hourTy h, minuteTy m, secondTy s, bool dst)
 /*
                 if (IsDST()) setError(NIHCL_BADTIME,DEFAULT,
                                                                date.dayOfMonth(),date.nameOfMonth(),date.year(),
 /*
                 if (IsDST()) setError(NIHCL_BADTIME,DEFAULT,
                                                                date.dayOfMonth(),date.nameOfMonth(),date.year(),
-                                                               h,m,s,(dst?"DST":""));
+                                                               h,m,s,(dst?_("DST"):""));
 */
   }
   sec += TIME_ZONE;                               // adjust to GMT
 */
   }
   sec += TIME_ZONE;                               // adjust to GMT
@@ -266,6 +271,38 @@ secondTy wxTime::GetSecond() const
                  return (secondTy)(((sec % 86400) % 3600) % 60);
 }
 
                  return (secondTy)(((sec % 86400) % 3600) % 60);
 }
 
+secondTy wxTime::GetSecondGMT() const
+/*
+        Return the minute of this wxTime in GMT.
+*/
+{
+        return (secondTy)(((sec % 86400) % 3600) % 60);
+}
+
+int wxTime::GetDay() const
+{
+    wxDate da((wxDate) *this);
+    return da.GetDay();
+}
+
+int wxTime::GetDayOfWeek() const
+{
+    wxDate da((wxDate) *this);
+    return da.GetDayOfWeek();
+}
+
+int wxTime::GetMonth() const
+{
+    wxDate da((wxDate) *this);
+    return da.GetMonth();
+}
+
+int wxTime::GetYear() const
+{
+    wxDate da((wxDate) *this);
+    return da.GetYear();
+}
+
 wxTime wxTime::Max(const wxTime& t) const
 {
         if (t < *this) return *this;
 wxTime wxTime::Max(const wxTime& t) const
 {
         if (t < *this) return *this;
@@ -313,9 +350,9 @@ char *wxTime::FormatTime() const {
 
        if (Format == wx12h)
                if (GetHour() <= 12)
 
        if (Format == wx12h)
                if (GetHour() <= 12)
-                       strcat(timeBuf,"am");
+                       strcat(timeBuf,_("am"));
                else
                else
-                       strcat(timeBuf,"pm");
+                       strcat(timeBuf,_("pm"));
 
        return timeBuf;
 }
 
        return timeBuf;
 }
@@ -348,8 +385,8 @@ void wxTime::printOn(ostream& strm) const
         strm << ' ' << ((hh <= 12) ? hh : hh-12) << ':'
              << setfill('0') << setw(2) << GetMinute() << ':'
                                 << setfill('0') << setw(2) << GetSecond() << ' ';
         strm << ' ' << ((hh <= 12) ? hh : hh-12) << ':'
              << setfill('0') << setw(2) << GetMinute() << ':'
                                 << setfill('0') << setw(2) << GetSecond() << ' ';
-        if (hh < 12) strm << "am";
-        else strm << "pm";
+        if (hh < 12) strm << _("am");
+        else strm << _("pm");
 }
 
 wxTime::wxTime(OIOin& strm)
 }
 
 wxTime::wxTime(OIOin& strm)