Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle Timestamp, Max and Minimal Values

I was searching, also in the Oracle Doc, for the following:

  • What is the range for Timestamp in Oracle?

I know for date it is -4712, Jan-01 to 9999 Dec-31, but what for Timestamp?

Anyone a clue or hint where I can search?

like image 936
kamahl Avatar asked Mar 18 '12 18:03

kamahl


People also ask

What is the max value for TIMESTAMP?

The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59' . The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC.


1 Answers

You can always just try it:

SQL> select to_timestamp( '9999-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss' ) from dual;

TO_TIMESTAMP('9999-12-3123:59:59','YYYY-MM-DDHH24:MI:SS')
---------------------------------------------------------------------------
31-DEC-99 11.59.59.000000000 PM

and:

SQL> select to_timestamp( '9999-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss' )+1 from dual;
select to_timestamp( '9999-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss' )+1 from dual
                                                                     *
ERROR at line 1:
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
like image 102
eaolson Avatar answered Sep 20 '22 14:09

eaolson