Jump to content

Timestamp issues..


Scooby08

Recommended Posts

I'm getting a timestamp from an xml feed that I'd like to display in proper date format, but I'm not quite sure how to read this one.. The xml gives a 13 digit timestamp like so: 1263708279364

 

Here's where I'm at:

<?php
echo date('m/d/y h:i:s',1263713664290); // 06/22/01 11:54:26
?>

 

Now if I remove the last 3 digits I get this:

echo date('m/d/y h:i:s',1263713664); // 01/17/10 12:34:24

 

And that seems to be correct.. I guess the question is can the original timestamp that is given be formatted, or do I just have to remove the last 3 digits and call it good?

 

Thanks!!

Link to comment
https://forums.phpfreaks.com/topic/188763-timestamp-issues/
Share on other sites

The timestamp is the time in seconds since January 1st, 1970 GMT. Removing three places = not such a good result. You should read up on time EDIT: You're right, The extra three numbers is most likely milliseconds (such as what the microtime gives) and should be safely able to be removed.

Link to comment
https://forums.phpfreaks.com/topic/188763-timestamp-issues/#findComment-996490
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.