Oracle
 sql >> Datenbank >  >> RDS >> Oracle

oracle systimestamp (sysdate) in Millisekunden

  • DB-zeitzonenunabhängig
  • mit Millisekunden
  • funktioniert in XE
    function current_time_ms
        return number
    is
        out_result number;
    begin
        select extract(day from(sys_extract_utc(systimestamp) - to_timestamp('1970-01-01', 'YYYY-MM-DD'))) * 86400000 
            + to_number(to_char(sys_extract_utc(systimestamp), 'SSSSSFF3'))
        into out_result
        from dual;
        return out_result;
    end current_time_ms;