2002-11-22 19:31:44 +00:00
|
|
|
/*
|
|
|
|
* systime.c
|
|
|
|
*
|
|
|
|
* Maciej 'YTM/Elysium' Witkowiak, 22.11.2002
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
#include <geos.h>
|
|
|
|
|
2012-02-08 16:56:54 +00:00
|
|
|
time_t _systime(void)
|
|
|
|
{
|
|
|
|
struct tm currentTime;
|
2002-11-22 19:31:44 +00:00
|
|
|
|
|
|
|
currentTime.tm_sec = system_date.s_seconds;
|
|
|
|
currentTime.tm_min = system_date.s_minutes;
|
|
|
|
currentTime.tm_hour = system_date.s_hour;
|
|
|
|
currentTime.tm_mday = system_date.s_day;
|
|
|
|
currentTime.tm_mon = system_date.s_month;
|
|
|
|
currentTime.tm_year = system_date.s_year;
|
|
|
|
if (system_date.s_year < 87) {
|
2013-05-09 11:56:54 +00:00
|
|
|
currentTime.tm_year+=100;
|
2002-11-22 19:31:44 +00:00
|
|
|
}
|
|
|
|
currentTime.tm_isdst = -1;
|
|
|
|
|
|
|
|
return mktime(¤tTime);
|
|
|
|
}
|
|
|
|
|
2012-02-08 16:56:54 +00:00
|
|
|
clock_t clock(void)
|
|
|
|
{
|
2005-07-17 11:59:46 +00:00
|
|
|
return _systime();
|
|
|
|
}
|