oracle sysdate,systimestamp,current_date,current_timestamp

来源:互联网 发布:系统网络架构图 编辑:程序博客网 时间:2024/04/28 10:26

select sysdate,systimestamp,current_date,current_timestamp from dual;

 

 

这条语句返回 系统当前时间的三个版本,也有人这么说 叫做返回系统当前session所在时区的默认时间。

sysdate返回的是系统的时间。

systimestamp也是当前系统的时间戳。

CURRENT_TIMESTAMP 与时区设置有关,返回的秒是系统的,返回的日期和时间是根据时区转换过的。
current_date是对CURRENT_TIMESTAMP准确到秒的四舍五入。

 

These are features in Oracl9i or later version.
CURRENT_TIMESTAMP and CURRENT_DATE give session timestamp/date.
SYSTIMESTAMP and SYSDATE give databse date.
The two obviously may be in different timezones.


原创粉丝点击