To convert Unix time to regular MySQL DATETIME
select from_unixtime('1213907115');
It prints '2008-06-19 16:25:15'
To Convert DATETIME to unixtime
select unix_timestamp('2008-06-19 16:25:15');
It prints 1213907115
To Convert current date & time to unix time.
select unix_timestamp();
To Convert a column of DATETIME type to unixtime.
select unix_timestamp(c8013_date_created) from RealTimeStatus.T8013_PROGRAM;
select from_unixtime('1213907115');
It prints '2008-06-19 16:25:15'
To Convert DATETIME to unixtime
select unix_timestamp('2008-06-19 16:25:15');
It prints 1213907115
To Convert current date & time to unix time.
select unix_timestamp();
To Convert a column of DATETIME type to unixtime.
select unix_timestamp(c8013_date_created) from RealTimeStatus.T8013_PROGRAM;
No comments :
Post a Comment