FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

miliseconds to normal date

 


alalex
hi guys, I have a website, where I use timestamps in miliseconds to know when was a user last active.
Now, I want to put a "Last visit:" kind of thing, but I cannot display it in miliseconds since it is not understandable. So I would like to use php to convert it to date format, if possible.
If not, maybe to days, or hours, you know, something human-readable...

thanks!
alalex
well, I just figured it out!
The thing was to use the date function, and put as the parameter [timestamp] the timestamp!, yeah, it was obvious but It took me long... Wink

so finally I ended up with this:
Code:
$time  = mysql_result($result,$i,"timestamp"); //this is a custom function, it gets the timestamp
$last_date = date("j/m/Y",$time);


thanks anyway to those who where going to answer Wink
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.