AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_systime() (timestamp) -> php problem (https://forums.alliedmods.net/showthread.php?t=187409)

killergirl 06-12-2012 18:03

get_systime() (timestamp) -> php problem
 
Edit: now it's working, the problem was caused by apache server, I resolved it editing the php.ini. Anyway, sorry for this topic, get_systime() is working fine !

Hi,

I'm having problem with timestamp. I'm storing dates (timestamp and other infos) into a database, but when I'm converting them into normal display date (php function), the date does not match !

Ex, the output from server (via amxx): get_systime() -> 1339537875

Converting it into date (via php): date('d-m-Y / H:m:s', 1339537875);
I don't know why It's converted with 2 hours lost. It should be 03:00, but it's 01:00.

I also thought that I'm not converting by the normal US date (month / date / year) but is the same problem. But anyway, get_systime() is getting the timestamp from the same clock, right?

date('m-d-Y / H:m:s', 1339537875)

Thank you !

claudiuhks 06-12-2012 23:18

Re: get_systime() (timestamp) -> php problem
 
You also may use unix_timestamp( now( ) ) instead of using get_systime.
I mean you could get time in seconds elapsed since 1970 without doing any string, using %d with formatex.


All times are GMT -4. The time now is 06:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.