获取当前日期
now()
select now()
rst:2019-10-24 10:58:47.128771000
current_timestamp()
select current_timestamp()
rst:2019-10-24 11:29:43.718155000
now()和current_timestamp()等价,都是获取当前系统时间
unix_timestamp()
select unix_timestamp()
rst:1571886216
日期转换操作
转换成date
SELECT to_date(now());
rst:2019-10-24
SELECT to_date('2019-07-04');
rst:2019-07-04
字符串转成timestamp格式
select cast('1966-07-30' as timestamp);
rst:1966-07-30 00:00:00
select cast('1985-09-25 17:45:30.005' as timestamp);
rst:1985-09-25 17:45:30.005000000
select