Thread: Time Issues?
View Single Post
Old 06-10-2009, 01:53 AM   #2 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

That is the Unix timestamp of the current time and date. It is the amount of seconds since midnight of January the 1st, 1970. It is pretty standard in the programming world because it takes everything into consideration, leap years included.

It contains all the data you require for the time and date, with a precision of a second.

If we're to convert that Unix timestamp you supplied then we would convert it using the date function, in the specified format. All the available formats are described on its PHP.net page.

Just from that data you supplied I can tell you that is 02:36:48 using the following line of code:

php Code:
echo date('H:i:s', 1244597808);

Unfortunately, I am not sure on the date because I've not requested that information, but the timestamp still contains that data.

To see the time and the date for that timestamp I can do the following to tell you what it is:

php Code:
echo date('d-m-Y H:i:s', 1244597808);

I now know that timestamp is the 10th of June, 2009 at 02:36:48. This is also timezone specific because to me there are still the same amount of seconds since 1970, as there are to you, because the changes in the timezone are relative.

At this very second the timestamp is 1244598646. In Google we can see that is the equivalent to a very precise 39.4397936 years.

Edit: Sorry, I probably misread your post as I am ever so tired. In MySQL you can do the following:

sql Code:
SELECT CURTIME();
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
The Following 2 Users Say Thank You to Wildhoney For This Useful Post:
Randy (06-10-2009), Runar (06-10-2009)