数据库获取当前时间

    技术2022-05-19  20

    =======在MySql数据库 中用如下语句:

     

    select current_date;   获取当前 日期

     

    select current_time;    获取当前 时间

     

    select current_timestamp;  获取时间戳 就是日期时间

     

     

    =======在SqlServer数据库 中用如下语句:

     

    select getdate()

     

     

    =======在Oracle数据库 中用如下语句:

     Oracle自带的获取当前机器的系统时间的函数:Select   To_Char   (SYSDATE,'MM-DD-YYYY   HH24:MI:SS')   "now"   from   dual;  

      将系统时间赋给now参数.


    最新回复(0)