0
 select sysdate from dual;

I am working on Oracle 11g. I tried to get sysdate in sqldeveloper,but this is showing me incorrect date And everyday I get different dates.How to set correct date in sqldeveloper?

Version Banner - Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.2.0.3.0 - Production "CORE 11.2.0.3.0 Production" TNS for Solaris: Version 11.2.0.3.0 - Production NLSRTL Version 11.2.0.3.0 - Production

select * from nls_session_parameters;

NLS_LANGUAGE    AMERICAN
NLS_TERRITORY   AMERICA
NLS_CURRENCY    $
NLS_ISO_CURRENCY    AMERICA
NLS_NUMERIC_CHARACTERS  .,
NLS_CALENDAR    GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE   AMERICAN
NLS_SORT    BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT    DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT  HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY   $
NLS_COMP    BINARY
NLS_LENGTH_SEMANTICS    BYTE
NLS_NCHAR_CONV_EXCP FALSE

select * from nls_database_parameters;

NLS_LANGUAGE    AMERICAN
NLS_TERRITORY   AMERICA
NLS_CURRENCY    $
NLS_ISO_CURRENCY    AMERICA
NLS_NUMERIC_CHARACTERS  .,
NLS_CHARACTERSET    WE8ISO8859P1
NLS_CALENDAR    GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE   AMERICAN
NLS_SORT    BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT    DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT  HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY   $
NLS_COMP    BINARY
NLS_LENGTH_SEMANTICS    BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET  AL16UTF16
NLS_RDBMS_VERSION   11.2.0.3.0
Kaushal Talniya
  • 182
  • 2
  • 5
  • 12
  • You should get a different date every day *8-) How is it wrong - what day/time does it show, what do you expect, and what time zone(s) are you and the DB server in? Maybe you just want to see [your local time via `current_date`](https://stackoverflow.com/a/17925834/266304) instead? – Alex Poole Jul 09 '18 at 07:03
  • Today it is showing '06-OCT-24' , different date means , different wrong dates :) .I am working with Oracle databases.Time zone is IST. – Kaushal Talniya Jul 09 '18 at 07:13
  • Can you edit your question to show the output of `select * from nls_session_parameters` and `select * from nls_database_parameters`, and also include the version of SQL Developer you are using? Presumably this is a calendar clash but I'm not quite sure how to reproduce it yet. – Alex Poole Jul 09 '18 at 07:43
  • @AlexPoole , I edited the question and provided the version info as well.Could you please have a look on this. – Kaushal Talniya Jul 09 '18 at 09:12
  • What version of SQL Developer are you using then? And which version of Java is it running under? (Look in Help->About->Version). With those settings I can only guess a JDBC driver issue. – Alex Poole Jul 09 '18 at 09:32
  • Java(TM) Platform -> 1.7.0_67 and Oracle IDE -> 4.0.2.15.21 – Kaushal Talniya Jul 09 '18 at 09:57
  • 1
    I assume the data is actually correct on the server/PC the database is actually running on? Can you connect to it any other way, e.g. through SQL\*Plus either locally or remotely, and check what sysdate shows there; and also if possible what the time says on the host itself? – Alex Poole Jul 09 '18 at 10:06
  • 1
    @AlexPoole yeah, this is a db/server issue - not SQL Dev. – thatjeffsmith Jul 09 '18 at 12:54
  • @AlexPoole,@thatjeffsmith , I checked in server, someone has changed the date there. I got the issue. Thanks for your help. – Kaushal Talniya Jul 10 '18 at 05:36
  • https://www.talkapex.com/2012/08/setting-sysdate-in-oracle-for-testing/ This may help.. – YLG Jul 11 '18 at 13:00

0 Answers0