[Plugin] CTime Library
#14

Hi, there is my code but I get a warning.
Код:
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
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.
Reply


Messages In This Thread
CTime Library - by RyDeR` - 30.10.2011, 23:15
Re: CTime Library - by iNorton - 30.10.2011, 23:23
Respuesta: CTime Library - by GantaIgarashi - 30.10.2011, 23:25
Re: CTime Library - by Kar - 30.10.2011, 23:26
Re: CTime Library - by Stigg - 30.10.2011, 23:26
Re: CTime Library - by GangsTa_ - 30.10.2011, 23:29
Re: CTime Library - by Scenario - 30.10.2011, 23:49
Re: CTime Library - by Gamer_Z - 31.10.2011, 06:11
Re: CTime Library - by SampEver1 - 31.10.2011, 06:17
Re: CTime Library - by RyDeR` - 31.10.2011, 07:27
Re: CTime Library - by Hugo1984 - 08.01.2012, 20:59
Re: CTime Library - by Scenario - 16.01.2012, 14:53
Respuesta: CTime Library - by [Nikk] - 16.01.2012, 22:10
AW: CTime Library - by Atrox95 - 11.04.2012, 19:38
Re: CTime Library - by steki. - 01.05.2012, 17:56
Re: CTime Library - by Ballu Miaa - 02.05.2012, 02:12
Re: CTime Library - by Pedrex - 12.07.2012, 02:47
Re: CTime Library - by Pedrex - 12.07.2012, 23:08
AW: CTime Library - by Meta - 15.07.2012, 18:06
Re: CTime Library - by Reboma - 17.07.2012, 09:27
Re: CTime Library - by xRotem - 22.08.2013, 21:55
Re: CTime Library - by TheArcher - 25.08.2013, 06:46
Re: CTime Library - by Admigo - 28.09.2013, 16:01
Re: CTime Library - by Mark™ - 28.09.2013, 20:27
Re: CTime Library - by Admigo - 29.09.2013, 07:32
Re: CTime Library - by xPlay - 01.10.2013, 06:25
Re: CTime Library - by Ballu Miaa - 24.01.2014, 02:08
Re: CTime Library - by Ballu Miaa - 24.01.2014, 13:02
Re: CTime Library - by Ballu Miaa - 25.01.2014, 06:33
Re: CTime Library - by AndreT - 20.02.2014, 17:38
Re: CTime Library - by Marricio - 28.07.2014, 01:49
Re: CTime Library - by Mark_Weston - 18.10.2014, 22:44
Re: CTime Library - by justice96 - 20.12.2014, 12:36
Re: CTime Library - by FinStar - 09.03.2015, 16:27
Re: CTime Library - by EmpireSk - 09.03.2015, 17:18
Re: CTime Library - by Kar - 28.04.2015, 23:43
Re: CTime Library - by delfino - 06.02.2016, 09:24
Re: CTime Library - by vannesenn - 16.06.2016, 10:15
Re: CTime Library - by Gigi-The-Beast - 16.06.2016, 11:38
Re: CTime Library - by vannesenn - 18.06.2016, 01:29

Forum Jump:


Users browsing this thread: 3 Guest(s)