Unix Timestamp To GMT in php

by Ramya 2008-09-10 13:06:53

Unix Timestamp To GMT:


Convert UNIX TIMESTAMP to GMT in PHP using gmdate function.

> Get unix time in a variable as,

$unixtime = time();


> Then convert into GMT form as,

$gmttime = gmdate("Y-m-d H:i:s", $unixtime);

For example,
It will result as,
2008-09-10 07:45:35

Try converting Unix timestamp - GMT.

Tagged in:

1284
like
0
dislike
0
mail
flag

You must LOGIN to add comments