MySQL timestamp and date and time stamp system conversion date conversion between MySQL

Second level conversion time (accurate to the second)

1, UNIX date stamp is converted to a function: FROM_UNIXTIME ()

select FROM_UNIXTIME(1156219870); 

Output: 2006-08-22 12:11:10

2, with the date stamp is converted to UNIX functions: UNIX_TIMESTAMP ()

select UNIX_TIMESTAMP('2006-11-04 12:23:00');

Output: 1162614180

1, UNIX date stamp is converted to a function: FROM_UNIXTIME ()

select FROM_UNIXTIME(1156219870); 

Output: 2006-08-22 12:11:10

2, with the date stamp is converted to UNIX functions: UNIX_TIMESTAMP ()

select UNIX_TIMESTAMP('2006-11-04 12:23:00');

Output: 1162614180

Guess you like

Origin www.cnblogs.com/xiaozengzeng/p/12111397.html