Oracle equaivalent of java System.currentTimeMillis()?

后端 未结 4 1221
闹比i
闹比i 2021-02-02 00:37

I want to be able to store the current time in milliseconds in an Oracle number field. How do I do this via a query?

select systimestamp from dual; 
4条回答
  •  不知归路
    2021-02-02 01:05

    Try this -

    select extract(day from(sys_extract_utc(systimestamp AT TIME ZONE 'GMT') - to_timestamp('1970-01-01', 'YYYY-MM-DD'))) * 86400000 + to_number(to_char(sys_extract_utc(systimestamp AT TIME ZONE 'GMT'), 'SSSSSFF3')) from dual;

提交回复
热议问题