MYSQL Date field showing random numbers, how to work out date?

I've exported a database (I need the data for a report) we have a 'start date' which is the start date of each project, but in MYSQL it isn't showing a date but instead a random number, it must say the date in some way because the tasks seem to go in order and the numbers change accordingly.

Can anybody tell me how to work out the date from the numbers, an example is below:

1337156712

and another:

1321443614

Any help will be great thanks!

OK I am using this PHP script to change the dates:

<?php

$TimeStamp = "1185422400"; 

$Time = date("m-d-Y", $TimeStamp);  

echo $Time;

?>

Can somebody help me turn it into an array so I can include around 500 dates and convert them all at once?

Thanks

Ricky

Answers


Assuming your number is a Unix timestamp, FROM_UNIXTIME() will give you a formatted date you can use with DATETIME fields:

mysql> SELECT FROM_UNIXTIME(1321443614) AS time;
+---------------------+
| time                |
+---------------------+
| 2011-11-16 11:40:14 |
+---------------------+
1 row in set (0.00 sec)

There are plenty of other time functions available, all of which are listed here.


those are unix timestamps. They are the number of seconds past since Jan 1, 1970. There are a variety of function calls you can user to turn them into dates :)

I will be right back with a way to do it :)

select from_unixtime(1321443614) as time

arg! someone beat me to it!


Need Your Help

Capturing a hidden window in Vista

delphi windows-vista screen-capture

My understanding of Vista is that each window gets it's own screen buffer which is then alpha blended etc to create the screen.

How do I maximize code coverage?

c unix

Hey all, the following is a snippet of code taken from the unix ptx utility. I'm attempting to maximize code coverage on this utility, but I am unable to reach the indicated portion of code. Admitt...