Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.