Timestamp Problem
#1

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"...
Reply
#2

Anyone can help me with this? I cant get a working timestamp in pawn like you can do in php with "mktime"...
Reply
#3

gettime works, call it without arguments to get the seconds since 1970. Well its working on windows..
pawn Код:
new timestamp = gettime();
Reply
#4

try this -> http://pastebin.com/d4c9a35a5
Reply
#5

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...
Reply
#6

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
Reply
#7

Thanks to everybody, works as it should.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)