Page 1 of 1

UNIX timestamp to regular time [SOLVED]

Posted: Thu Apr 05, 2007 7:35 am
by mikeeeeeeey
Hi guys (again)

I've scoured the web and can't find anything about any preset function to covert POSIX to a more meaniful format which I can take apart.

Anyone know of any? or have any ideas on how to do it?

Thanks in advance :D

Posted: Thu Apr 05, 2007 7:38 am
by mentor
Did you try date()

Posted: Thu Apr 05, 2007 7:47 am
by mikeeeeeeey
I've checked it out, but I can't find anything about going from POSIX to the time.

It all seems to be from the time to POSIX. :(

Posted: Thu Apr 05, 2007 7:57 am
by mentor
You can pass 2 parameters to date() function, one is format and 2nd is timestamp. Check the manual again.
Try something like

Code: Select all

echo date("F j, Y, g:i a", $timestamp);

Posted: Thu Apr 05, 2007 8:14 am
by mikeeeeeeey
ahh nice one,

Code: Select all

date("F j, Y, g:i a", filemtime($file))
that's the one, thanks mentor :D