Game Development Community

Incorrect Month in file dates - LOGGED

by Rex Hiebert · in Torque 3D Professional · 05/11/2010 (8:23 am) · 2 replies

Torque3D v1.0.1
Win7

fileModifiedTime()
fileCreatedTime()

both return the month as +1 from what it should be.

Fix-
in winTime.cpp
String Platform::localTimeToString( const LocalTime &lt )

change the line
st.wMonth         = lt.month + 1;

to
st.wMonth         = lt.month;


#1
05/12/2010 (5:33 pm)
in platform.h
// Time
   struct LocalTime
   {
      U8  sec;        ///< Seconds after minute (0-59)
      U8  min;        ///< Minutes after hour (0-59)
      U8  hour;       ///< Hours after midnight (0-23)
      U8  month;      ///< Month (0-11; 0=january)
      U8  monthday;   ///< Day of the month (1-31)
      U8  weekday;    ///< Day of the week (0-6, 6=sunday)
      U16 year;       ///< Current year minus 1900
      U16 yearday;    ///< Day of year (0-365)
      bool isdst;     ///< True if daylight savings time is active
   };
the value range of Month is 0-11(0 means january)
#2
06/05/2010 (11:31 am)
logged: TQA-228