Toad not showing correct Database time

Version 14.1 / Oracle 19.11 / Windows 10

when in SQLplus on the server in OCI sysdate returns the coirrect date and time, however when we execute select sysdate from dual in Toad we get the time as being 1 hour behind what the database says it is.

does anyone know if there is a setting in Toad to fix this or is it a bug?

Are the dates on both servers (where Oracle is vs where Toad is) the same? Asking since I think Oracle takes the sysdate from the OS.

Toad is on our desktoips so no servers, yes the date is the same eveywhere, the only difference is the 1 hour behind in Toad as compared to SQLPLUS

Sorry, meant the Oracle server and your Toad workstation. Not sure, then...

Only thing I can think of at the moment is that the TimeZone settings are different for SQLPlus client vs. server.

Is this post of any help at all.

I've had similar problems in the cloud. The application code used SYSDATE throughout and was getting the wrong times back as the cloud servers were all Oracle Linux with the UTC timezone. We were not allowed to change that.

If I remember correctly, we changed the code to use CURRENT_DATE instead.

SYSDATE returns the server time with apparently no adjustments for the session timezone. In our case, we got UTC from the server. Our sessions were in BST and thus an hour out.

CURRENT_DATE returns the server date and time adjusted to the sessions timezone.

If SQLPlus gives different results from Toad, check your session timezone for each and compare.

Select SESSION TIME ZONE, DBTIMEZONE
from dual;

HTH

Cheers,
Norm. [TeamT]

Toad does not manipulate the sysdate value in any way. The value comes from Oracle.

I think Norm is right. This feels like a timezone difference to me.

I suspect Toad gets its timezone from the control panel setup in Windows. I would have though SQL*Plus should also, but don't know.

Toad would then be setting the session timezone appropriately and dates etc would be correct, except SYSDATE doesn't care about the session timezone, only the DB Server timezone.

Perhaps!

Cheers,
Norm. [TeamT]

@NormTeamT when OP first mentioned SQL*Plus, it was on the server, so my guess is that the PC and server are in different time zones. I'd be willing to bet that SQL*Plus on the desktop and Toad give the same sysdate.

Ah, right, I either missed that, or completely forgot. I blame a lack of sleep due to having an 11 week old puppy running my life!

I would agree with you then. The server and PC are most likely in different timezones. OCI is always (?) set to UTC and I'm not sure it is allowed to be changed.

In my last contract, we were not allowed to change it. That was OCI.

Take care, hope you are well John. Greetings from "Plague Island". :frowning_face:

Cheers,
Norm. [TeamT]

1 Like

Hi everyone!
I have a similar issue, because i have a server that the last month when in SQLplus we execute "Select sysdate from dual" get the time as to be 1 hour plus of what the database says.

for example in oracle linux server get:
06-APR-24 04.59.11.101580 PM -05:00

but in my pc client (SQLplus or sqldeveloper tool) get:
06/04/24 17:59:15,645683 -04:00

I suspect that they have migrated the server to another region, but I don't know how to be sure.

On the other hand, I do not see any parameter change in the database alterlog.

There is no bug here. Your database and client PCs are in a different time zone (or at least the OS are set to different time zones)

Hello John!

I hope you are well! I asked the servers admin and he told me that they did not make any changes, and I know that the database area, there was no change in the database.
However, after checking all sides we just restarted the database and the ASM grid and then the clients' time returned to normal.

Customer:
04/13/24 01:45:44,063729000 PM -05:00
Database server:
13-APR-24 01.45.45.300854 PM -05:00

Anyway, I have my doubts.