11.04.2012, 19:38
Hi, there is my code but I get a warning.
The output works fine: diff: 3686 seconds
(~ 1 hour) -> Works!
> warning 213: tag mismatch
It seems that the newTime format is wrong, how to fix it?
I want to save the current time in my database (MySQL) on leaving the server to check the time difference on login.
But I cannot save it correct with format(..., "%d", gettime()); Because the format is not an integer but a Time object.
So I want to save the date information containing mms:hh, dd:mm:yy
Then I can create a new Time: and calculate the difference.
Код:
stock Time: cttime() return Time: gettime(); //.... new Time: starttime = cttime(); new tm <tmWeekDay> ; tmWeekDay[tm_sec] = 1 - 1; tmWeekDay[tm_min] = 36 - 1; tmWeekDay[tm_hour] = 20 - 1; tmWeekDay[tm_mday] = 11; tmWeekDay[tm_mon] = 04 - 1; tmWeekDay[tm_year] = 2012 - 1900; new Time:newTime = mktime(tmWeekDay); printf("diff: %d seconds", difftime(starttime, newTime));//warning 213: tag mismatch
(~ 1 hour) -> Works!
> warning 213: tag mismatch
It seems that the newTime format is wrong, how to fix it?
I want to save the current time in my database (MySQL) on leaving the server to check the time difference on login.
But I cannot save it correct with format(..., "%d", gettime()); Because the format is not an integer but a Time object.
So I want to save the date information containing mms:hh, dd:mm:yy
Then I can create a new Time: and calculate the difference.