10种数据库获取当前时间/服务器时间(Oracle、Infomix、DB2、SQL Server、Access 、Sybase、MySQL、FoxPro、Sqlite、postgreSQL)

10种数据库获取当前时间/服务器时间(Oracle、Infomix、DB2、SQL Server、Access 、Sybase、MySQL、FoxPro、Sqlite、postgreSQL)

1、Oracle数据库:select sysdate from Table1;  

2、Infomix数据库:select current from sysmaster:sysshmvals;

3、DB2数据库:select current timestamp from sysibm.sysdummy1

4、SQL Server数据库:select getdate();

5、Access 数据库:select * from table1 where Date=" & date()

6、Sybase数据库:select getdate();

7、MySQL数据库:select sysdate();    //等同 select now() --yyyy-MM-dd HH:mm:ss      select current_date  --yyyy-MM-dd

8、FoxPro数据库:select date();

9、Sqlite数据库:select 1  或 select (datetime('now'))     //select strftime('%Y-%m-%d %H:%M:%f','now') 精确到毫秒,select strftime('%s','now')  时间戳

10、postgreSQL数据库:select sysdate();

 

 

创建时间:2021.03.30  更新时间:

posted on 2021-03-30 11:24  滔Roy  阅读(922)  评论(0编辑  收藏  举报

导航