Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

void OSystem_PS2::getTimeAndDate ( TimeDate t ) const [virtual]

Get the current time and date, in the local timezone. Corresponds on many systems to the combination of time() and localtime().

Implements OSystem.

Definition at line 109 of file ps2time.cpp.

References TimeDate::tm_hour, TimeDate::tm_mday, TimeDate::tm_min, TimeDate::tm_mon, TimeDate::tm_sec, and TimeDate::tm_year.

                                                  {

      uint32 currentSecs = g_timeSecs + (msecCount - g_lastTimeCheck) / 1000;
      if (currentSecs >= SECONDS_PER_DAY) {
            buildNewDate(+1);
            g_lastTimeCheck += SECONDS_PER_DAY * 1000;
            currentSecs = g_timeSecs + (msecCount - g_lastTimeCheck) / 1000;
      }

      t.tm_hour = currentSecs / (60 * 60);
      t.tm_min  = (currentSecs / 60) % 60;
      t.tm_sec  = currentSecs % 60;
      t.tm_year = g_year + 100;
      t.tm_mday = g_day;
      t.tm_mon  = g_month - 1;
}

Generated by  Doxygen 1.6.0   Back to index