Timestamp Problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Timestamp Problem (
/showthread.php?tid=91721)
Timestamp Problem -
Doktor - 16.08.2009
Hi,
im trying to create a timeban system using a timestamp. I need this timestamp from several other things...So i searched this Forum, looked in the wiki and found some things, that seemed to help me:
1.) I tried makabos timestamp function, which doesnt worked for me correctly: I used another function to convert this timestamp to a date, which showed the right time, but the wrong date, so makabos timestamp doesnt work for me
2.) I tried gettime, which should return the seconds since 1970 (timestamp), but it doenst work either, displayed the right date and the wrong time...
3.) tried boyletts functions, which doenst work either
Im running my gamemode on a linux server, so is there any bug with this or could someone send me a working timestamp function, like in php "mktime"...
Re: Timestamp Problem -
Doktor - 17.08.2009
Anyone can help me with this? I cant get a working timestamp in pawn like you can do in php with "mktime"...
Re: Timestamp Problem -
paytas - 17.08.2009
gettime works, call it without arguments to get the seconds since 1970. Well its working on windows..
pawn Код:
new timestamp = gettime();
Re: Timestamp Problem - Zeex - 17.08.2009
try this ->
http://pastebin.com/d4c9a35a5
Re: Timestamp Problem -
Doktor - 17.08.2009
Thanks to both of you, gettime() doesnt work. The Code Zee posted showed the correct time, but the wrong date. Today we have the 17., but it shows 19., so two days difference...
Re: Timestamp Problem -
dice7 - 17.08.2009
http://pastebin.com/m2f902095
note, this code is the same as the above one, it just returns the day 2 days earlier, to counter your problem
Re: Timestamp Problem -
Doktor - 18.08.2009
Thanks to everybody, works as it should.