473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

DST Compliance

Will someone (Serge wink-wink) weigh in on a DST question?

I understand completely that DB2 relies on the operating system to
retrieve the date. That said, DB2 will allow me to add time to a
timestamp to the extent that DB2 will return an invalid time:

$ db2 values current timestamp + 23 days + 12 hours

1
--------------------------
2007-03-11-02.53.27.895029

1 record(s) selected.
(this is a patched server, perl returns 2007-03-11-03.53.27.895029, as
a control I ran this test for the "old" DST dates and receivedd the
same results)

So if I put on my IBM hat, I would argue that once we pass 01:59:59 on
3/11, db2 will continue to return the correct timestamp, however if I
want to be a DST purist, then acknowledging
"2007-03-11-02.53.27.895029" even exists, and allowing it to be stored
as a timestamp is no more accurate than allowing a garbled character
string to be stored as a timestamp.
t

Feb 15 '07 #1
3 2113
ts******@gmail.com wrote:
Will someone (Serge wink-wink) weigh in on a DST question?

I understand completely that DB2 relies on the operating system to
retrieve the date. That said, DB2 will allow me to add time to a
timestamp to the extent that DB2 will return an invalid time:

$ db2 values current timestamp + 23 days + 12 hours

1
--------------------------
2007-03-11-02.53.27.895029

1 record(s) selected.
(this is a patched server, perl returns 2007-03-11-03.53.27.895029, as
a control I ran this test for the "old" DST dates and receivedd the
same results)

So if I put on my IBM hat, I would argue that once we pass 01:59:59 on
3/11, db2 will continue to return the correct timestamp, however if I
want to be a DST purist, then acknowledging
"2007-03-11-02.53.27.895029" even exists, and allowing it to be stored
as a timestamp is no more accurate than allowing a garbled character
string to be stored as a timestamp.
I have no clue what the rules are here...
Don't even know whom to ask (which is rare)...

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Feb 15 '07 #2
On Feb 15, 4:55 pm, Serge Rielau <srie...@ca.ibm.comwrote:
tsmit...@gmail.com wrote:
Will someone (Serge wink-wink) weigh in on a DST question?
I understand completely that DB2 relies on the operating system to
retrieve the date. That said, DB2 will allow me to add time to a
timestamp to the extent that DB2 will return an invalid time:
$ db2 values current timestamp + 23 days + 12 hours
1
--------------------------
2007-03-11-02.53.27.895029
1 record(s) selected.
(this is a patched server, perl returns 2007-03-11-03.53.27.895029, as
a control I ran this test for the "old" DST dates and receivedd the
same results)
So if I put on my IBM hat, I would argue that once we pass 01:59:59 on
3/11, db2 will continue to return the correct timestamp, however if I
want to be a DST purist, then acknowledging
"2007-03-11-02.53.27.895029" even exists, and allowing it to be stored
as a timestamp is no more accurate than allowing a garbled character
string to be stored as a timestamp.

I have no clue what the rules are here...
Don't even know whom to ask (which is rare)...
This is a very interesting question. Here's my take on the situation.

While DB2 relies the OS to get the current time (and to handle
adjustments such as DST and timezone), that's the extent of its
interaction with the OS. All date arithmetic (ie, + 23 days + 12
hours) is handled internally to the engine, and we don't further
validate the resultant date to see if it falls into a DST blackhole.

This is yet another example of why it's best to record dates in any
database application using UTC, and to apply the DST/timezone
conversions on the client. Times, just like dates, currency and
floating-point values are subject to locale conversions, and timezone/
DST is very locale-centric.

Matt Emmerton

Feb 16 '07 #3
On Feb 15, 7:46 pm, "memme...@yahoo.com" <m...@gsicomp.on.cawrote:
On Feb 15, 4:55 pm, Serge Rielau <srie...@ca.ibm.comwrote:


tsmit...@gmail.com wrote:
Will someone (Serge wink-wink) weigh in on a DST question?
I understand completely that DB2 relies on the operating system to
retrieve the date. That said, DB2 will allow me to add time to a
timestamp to the extent that DB2 will return an invalid time:
$ db2 values current timestamp + 23 days + 12 hours
1
--------------------------
2007-03-11-02.53.27.895029
1 record(s) selected.
(this is a patched server, perl returns 2007-03-11-03.53.27.895029, as
a control I ran this test for the "old" DST dates and receivedd the
same results)
So if I put on my IBM hat, I would argue that once we pass 01:59:59 on
3/11, db2 will continue to return the correct timestamp, however if I
want to be a DST purist, then acknowledging
"2007-03-11-02.53.27.895029" even exists, and allowing it to be stored
as a timestamp is no more accurate than allowing a garbled character
string to be stored as a timestamp.
I have no clue what the rules are here...
Don't even know whom to ask (which is rare)...

This is a very interesting question. Here's my take on the situation.

While DB2 relies the OS to get the current time (and to handle
adjustments such as DST and timezone), that's the extent of its
interaction with the OS. All date arithmetic (ie, + 23 days + 12
hours) is handled internally to the engine, and we don't further
validate the resultant date to see if it falls into a DST blackhole.

This is yet another example of why it's best to record dates in any
database application using UTC, and to apply the DST/timezone
conversions on the client. Times, just like dates, currency and
floating-point values are subject to locale conversions, and timezone/
DST is very locale-centric.

Matt Emmerton- Hide quoted text -

- Show quoted text -
So if I convert to UTC, is it safe to say the CURRENT TIMEZONE special
register uses TZ so as long as I'm OS patched I am OK ?

Feb 16 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

119
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
100
by: Roose | last post by:
Just to make a tangential point here, in case anyone new to C doesn't understand what all these flame wars are about. Shorthand title: "My boss would fire me if I wrote 100% ANSI C code" We...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.