How to check the timezone of oracle pl/sql developer

47,958

Solution 1

I just ran select systimestamp from dual; in SQL developer on my machine, it replied with 30-MAY-16 12.49.28.279000000 PM -05:00. The -05:00 shows the timezone offset (5 hours behind UTC, essentially 5 hours behind GMT with no daylight savings time adjustments made to GMT). This shows the database server time zone.

Then I ran select current_timestamp from dual; and I got: 30-MAY-16 12.54.17.762000000 PM AMERICA/CHICAGO which in fact is the same timezone (but in different format - it depends on the settings I have). I get the same result because my "server" is on my personal laptop, which is also the "client". In the general case, the timezone component from this query will be the "local" or "client" or "session" timezone, while the first query (with systimestamp) gives the "server" or "database" timezone.

Solution 2

TIMESTAMP WITH LOCAL TIME ZONE does not store time zone information internally, but you can see local time zone information in SQL output if the TZH:TZM or TZR TZD format elements are specified.

Try this:

select TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') from dual
Share:
47,958
sith
Author by

sith

Updated on May 31, 2020

Comments

  • sith
    sith almost 4 years

    Where do I check the timezone of oracle pl/sql developer.Can someone help please

  • ABaumstumpf
    ABaumstumpf about 2 years
    This does not actually address the question but already assumes that the database is setup to the users liking (in this case it is not)
  • mathguy
    mathguy about 2 years
    @ABaumstumpf - You came to this question six years after it was asked and answered. The OP marked this as "correct answer" (so perhaps it IS the correct answer to HIS question), and ten other people found the answer "useful". If you had an objection, did it ever cross your mind to state it in a Comment, then WAIT FOR AN ANSWER for a day or two, and THEN mark a down-vote if the answer didn't come, or if it wasn't to your satisfaction?
  • mathguy
    mathguy about 2 years
    @ABaumstumpf - To address your objection: My answer doesn't "assume" anything. The poster asked "how to CHECK the timezone", not "how to SET the timezone [to somebody's liking]". If you don't understand the difference between "checking" and "setting", that's on you. Judging by the votes, a lot of other people on this forum do understand it. Also, you say "in this case it is not". In what case? Obviously the OP didn't say anywhere that his timezone is not to his liking - for the obvious reason that he didn't even know what it was to begin with. That was the whole point of the question.