Skip to content

Instantly share code, notes, and snippets.

@tomask-de
Last active April 21, 2016 10:55
Show Gist options
  • Save tomask-de/4b2a246c5334b4669f3770be7e0150b0 to your computer and use it in GitHub Desktop.
Save tomask-de/4b2a246c5334b4669f3770be7e0150b0 to your computer and use it in GitHub Desktop.
Convert a Java timestamp (long value) saved in an Oracle database as NUMBER(16) into a readable string
-- 2177452800000000 = diff from 01.01.1970 00:00:00.000000 to 01.01.1901 00:00:00.000000
select timestamp '1970-01-01 00:00:00' + numtodsinterval((STAMP - 2177452800000000)/1000/1000,'SECOND') from DUAL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment