This is my current code that doesn’t seem to work correctly.
echo date("h:i", 1*60*60) ; /* 1*60*60 mean 1 hours right */
The result is 03:00 when it should be 01:00.
Where is this going wrong?
i want to do this
1- employee come in time admin select it
2- employee come – leave saved in mysql as timestamp
Now I’m trying to make admin see how many hours user late
mean
user date time default late
user1 11-09-2011 09:10 09:00 10 min
user1 12-09-2011 08:00 09:00 -60 min
If you output just
date("Y-m-d H:i:s",0)you should see that it’s not1970-01-01 00:00:00as it should be. It’s becausedateis affected by your local timezone. For example I’m in GMT +3, anddate("Y-m-d H:i:s")gives me1970-01-01 03:00:00.So the answer is you are not in GMT timezone (probably in GMT+2), and
dateis affected by it.UPDATE
The following code outputs
1970-01-01 00:00:00, so it’s definitely time zones.Hovewer, I can’t see any mention about it in PHP’s
datemanual.