FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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
Related topics
Laugh out loud
[java scripts] Text effect , img ....
Clock-javascript
10 Reasons to Date a Hockey Player
Google's Secret Revealed
Installing, Partitioning & Formatting HDDs
FTP - file last modified date
keep your adblocking up to date
Google News Offers RSS and Atom Feeds
[PhP] News Posting Tutorial (code, actually ^^')
Need help with Java
sims 2 -nightlife , review
Confused lover
Lovin' My Brother
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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