UBB.Dev
Posted By: Dslam mysql time or unix time convert - 07/27/2003 6:20 AM
if I do this
SELECT U_Laston FROM w3t_Users WHERE U_Username= 'dslam'
it will return "1055589726"
well this is not readable to me so is there a way to convert this?
Posted By: JoshPet Re: mysql time or unix time convert - 07/27/2003 6:27 AM
it's the number of seconds since Epoch time... (Jan 1 1970).

I wrote a little script to convert it and vice versa here.

I also have it installled here:
http://www.joshuapettit.com/time.php
Posted By: Dslam Re: mysql time or unix time convert - 07/27/2003 6:39 AM
should have know you wrote something
thanks this is useful
Posted By: Gardener Re: mysql time or unix time convert - 07/27/2003 6:32 PM
You could also write the query like this to get the date and time directly:

SELECT FROM_UNIXTIME(U_Laston) FROM w3t_Users WHERE U_Username= 'dslam'
Posted By: dimopoulos Re: mysql time or unix time convert - 07/29/2003 12:22 AM
And add to that the DATE_FORMAT(FROM_UNIXTIME(U_Laston), blah) to format the date on the SQL query. More help on the parameters that the DATE_FORMAT takes can be found here.
Posted By: Dslam Re: mysql time or unix time convert - 07/30/2003 4:38 AM
thanks guy's
© UBB.Developers