Click to See Complete Forum and Search --> : how can i convert unix time o time in php?


pelegk1
04-06-2005, 06:17 AM
what is the fast way?

Jona
04-06-2005, 06:19 AM
Um, date() (http://www.php.net/date)?

pelegk1
04-06-2005, 06:53 AM
but i want to give the unix time and get the current date+month
!

Jona
04-06-2005, 10:40 AM
Give the UNIX time to PHP and convert it to a human-readable date?

the tree
04-06-2005, 10:55 AM
Jona, that is exactly what he was asking how to do.

NogDog
04-06-2005, 11:07 AM
date() (http://us2.php.net/manual/en/function.date.php)
gmdate() (http://us2.php.net/manual/en/function.gmdate.php)
localtime() (http://us2.php.net/manual/en/function.localtime.php)

Jona
04-06-2005, 11:36 AM
I don't know about you, but I like to avoid wasting my time by making sure I know what I'm helping someone do before I write any code.

ShrineDesigns
04-06-2005, 02:31 PM
a unix timestamp is an integer, thus <?php
$int = mktime(0, 0, 0, 1, 1, 1983);
echo date('m-d-Y', $int);
?>