Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How MySql Database Converts Long Time and Date to each other
How MySql Database Converts Long Time and Date to each other
1

I use the SQLyog database client. Convert a long time into a date format through from_unixtime. The specific usage is as follows: select from _ unixtime (1388776825); Just execute it.

2

You can also add a time format, which is used as follows:

Select from _ unix time (1388776825,'% y %m %d') result: 20140104 select from _ unix time (1388776825,'% y year.

three

If you want to reverse the transformation, you can reverse the transformation through the unix_timestamp () function. Usage is as follows:

SELECT UNIX _ TIMESTAMP(); //Get the seconds of the current time

SELECT UNIX _ TIMESTAMP(' 20 14-03-23 10: 10:40 '); //Gets the number of seconds in the specified date format.

SELECT UNIX _ TIMESTAMP(' 20 14-03-23 '); //Gets the number of seconds in the specified date format.