Forum Post: RE: Inconsistency assigning date var to datetime-tz vs. using the date function

  • Thread starter Thread starter Robin Brown
  • Start date Start date
Status
Not open for further replies.
R

Robin Brown

Guest
Hi Tom, As you have shown, there is a difference between taking a datetime-tz and assigning it to a date and taking the date part of a datetime-tz and assigning it to a date. Per the documentation on the DATE(datetime-expression) function: If datetime-expression is a DATETIME-TZ, the DATE function returns the date relative to the time zone of the DATETIME-TZ value. For example, a DATETIME-TZ field, fdt , is created in London (time zone UTC+00:00) with a value of May 5, 2002 at 7:15:03.002 am . DATE ( fdt ) returns 05/05/2002 , regardless of the session’s time zone. For straight assignment between date and datetime-tz, we do take the session’s time zone into account. So I would not consider this a bug. Regards, Robin From: Brian K. Maher [mailto:bounce-maher@community.progress.com] Sent: Wednesday, April 09, 2014 11:02 AM To: TU.OE.Development@community.progress.com Subject: RE: Inconsistency assigning date var to datetime-tz vs. using the date function RE: Inconsistency assigning date var to datetime-tz vs. using the date function Reply by Brian K. Maher Tom, I think this is a bug. Please open a support call for it. Thanks, Brian From: tbergman [ mailto:bounce-tbergman@community.progress.com ] Sent: Wednesday, April 09, 2014 10:54 AM To: TU.OE.Development@community.progress.com Subject: Inconsistency assigning date var to datetime-tz vs. using the date function Inconsistency assigning date var to datetime-tz vs. using the date function Thread created by tbergman Progress 11.3 Windows. The following code illustrates the problem. It's likely sensitive to the time zone you're in when you run it. In our testing, in the Eastern time zone, the problem occurs when we are in a timezone that is 1 hour ahead of the timezone stored in the datetime-tz variable. DEFINE VARIABLE vdateTZ AS DATETIME-TZ. DEFINE VARIABLE vDate1 AS DATE. DEFINE VARIABLE vDate2 AS DATE. vDateTZ = datetime-tz(4,9,2014,0,0,0,0,-180). vDate1 = vDateTZ. vDate2 = date(vDateTZ). MESSAGE now skip vDateTZ SKIP vDate1 SKIP vDate2 VIEW-AS ALERT-BOX. The output I get is: 04/09/2014 10:45:39.494-04:00 04/09/2014 00:00:00.000-03:00 04/08/14 04/09/14 Note the different dates shown by vDate1 and vDate2. Stop receiving emails on this subject. Flag this post as spam/abuse. Stop receiving emails on this subject. Flag this post as spam/abuse.

Continue reading...
 
Status
Not open for further replies.
Back
Top