MYSQL | date, time 함수.. unix_timestamp | |||||
---|---|---|---|---|---|
작성자 | 작성일 | 18-03-08 16:03 | |||
mysql> select date_format( now() , "%Y%m%d-%H%i%S"); +---------------------------------------+ | date_format( now() , "%Y%m%d-%H%i%S") | +---------------------------------------+ | 20050108-114845 | +---------------------------------------+ mysql> select date_format( 34252524323432 , "%Y%m%d-%H%i%S"); +------------------------------------------------+ | date_format( 34252524323432 , "%Y%m%d-%H%i%S") | +------------------------------------------------+ | NULL | +------------------------------------------------+ 1 row in set, 1 warning (0.00 sec) mysql> select unix_timestamp(); +------------------+ | unix_timestamp() | +------------------+ | 1105152570 | +------------------+ mysql> select date_format( unix_timestamp() , "%Y%m%d-%H%i%S"); +--------------------------------------------------+ | date_format( unix_timestamp() , "%Y%m%d-%H%i%S") | +--------------------------------------------------+ | NULL | +--------------------------------------------------+ 1 row in set, 1 warning (0.00 sec) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ mysql> select from_unixtime(now()); +----------------------+ | from_unixtime(now()) | +----------------------+ | 2008-01-20 06:26:44 | +----------------------+ mysql> select from_unixtime(1103152232); +---------------------------+ | from_unixtime(1103152232) | +---------------------------+ | 2004-12-16 08:10:32 | +---------------------------+ mysql> select from_unixtime(1103152232, "%Y%m%d-%H%i%S"); +--------------------------------------------+ | from_unixtime(1103152232, "%Y%m%d-%H%i%S") | +--------------------------------------------+ | 20041216-081032 | +--------------------------------------------+ mysql> select from_unixtime(1103152232, "%Y-%m-%d %H:%i:%S"); +------------------------------------------------+ | from_unixtime(1103152232, "%Y-%m-%d %H:%i:%S") | +------------------------------------------------+ | 2004-12-16 08:10:32 | +------------------------------------------------+ mysql> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [출처] [mysql] date, time 함수.. unix_timestamp|작성자 초코머루 |
|||||
|
댓글목록
등록된 댓글이 없습니다.