473,473 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Oracle Time Conversion from EST to UTC and Back is 1 hour off?

dlite922
1,584 Recognized Expert Top Contributor
I initially thought this had to do with Daylight savings time change, but now that it has passed in the US, I looked at the query and now I observed this behavior:

begin_time is my column and is assumed to be UTC+0.

This Yields 01:30
Expand|Select|Wrap|Line Numbers
  1. TO_CHAR(e.begin_time,'HH24:MI') BEGIN_UTC
  2.  
Okay, let's convert that to US/Eastern:

This Yeilds 20:30 (Makes sense, 01:30-5:00=20:30)
Expand|Select|Wrap|Line Numbers
  1. TO_CHAR(CAST((FROM_TZ(CAST(e.begin_time AS TIMESTAMP),'UTC') AT TIME ZONE 'US/Eastern') AS DATE),'HH24:MI') EST_BEGIN
  2.  
So let's take 20:30, and convert back to UTC just to test a clause that does this:

Expand|Select|Wrap|Line Numbers
  1. TO_CHAR(FROM_TZ(TO_TIMESTAMP('20:30','HH24:MI'),'US/Eastern') AT TIME ZONE 'UTC','HH24:MI') EST_2030
  2.  
You'd think it would return 01:30, it doesn't. the result is 00:30 (one hour before)

Am I doing one of the conversions wrong?

Thanks for any help, I'm running low on Coffee today I guess.

Dan
Nov 7 '11 #1
1 13860
dlite922
1,584 Recognized Expert Top Contributor
Semi-answer

If I give it the day as well, (today's date), it yields 01:30 AM correctly.

Expand|Select|Wrap|Line Numbers
  1. TO_CHAR(FROM_TZ(TO_TIMESTAMP('2011-11-07 20:30','YYYY-MM-DD HH24:MI'),'US/Eastern') AT TIME ZONE '+00:00','HH24:MI')
  2.  
Why doesn't Oracle assume Daylight Savings time (on/off) for today automatically when no day is given?

Weird. I guess I'll code in today's date automatically.
Nov 7 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: flupke | last post by:
Is there an easy to convert following hour notation hh:mm to decimals? For instance 2 hours and 30 minutes as 2:30 to 2,50 I don't really know where to search for this kind of conversion. ...
1
by: heirou | last post by:
I'm a novice in this subject....I've made a database that requires a time conversion. For example, if local time is 1200, determine the time in Korea. I use two fields: a date field, and a time...
3
by: Chandu | last post by:
Hi, I am working on awk programming which is similar to C programming and have got a doubt about time function returning a float value. Ex: 01:01:30 should return 61.5 when i have tried my way i...
1
by: bala | last post by:
Hi Access Gurus The MS Access DB (MS Access 2002 Database) which is currently serving as the backend Database to MS Access (MS Access 2002/XP) frontend needs to be converted to Oracle 8i Backend...
5
by: Paulers | last post by:
Hello, I'm working on an app that requires the functionality to convert the time in Austrailia to the time in New York (EST). I am wondering, what is the bestway to approach this in vb.net? Is...
3
by: moni | last post by:
This is all in C: I have 2 time values: System time and an input from the user. 1) System time is in the form of seconds from 1/1/1970 calculated by using time_t secs;
18
by: moni | last post by:
I have 2 time values: System time and an input from the user. 1) System time is in the form of seconds from 1/1/1970 calculated by using
3
by: Evan Klitzke | last post by:
Although it is not present in ANSI C, the GNU version of stftime supports the conversion character %z, which is a time offset from GMT. The four digit time offset is required in RFC 2822...
19
by: DonLi2006 | last post by:
Hi, ddl & dml project varchar(10) start char(5) stop char(5) ------------------------- ----- ----- hey now 21:00 19:25 new test 20:25 20:30 t 10 ...
1
by: arunbojan | last post by:
Hi friends..... Following is my code.... Dim FDT As DateTime = FDT.Now This will get the current date time..... How to find the time before one hour ?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.