If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Timestamp column in UTC converted format

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-23-11, 05:48
alwayssathya alwayssathya is offline
Registered User
 
Join Date: Aug 2010
Location: Chennai India
Posts: 161
Question Timestamp column in UTC converted format

hi

I wanted to have the timestamp in my table as UTC converted timestamp

i have created the column with a timestamp data type ,
based on the example in the link when trying to insert as mentioned i get a error.

And the link also shows datetime data type. which to my knowledge don exist in db2

here is the link

http://publib.boulder.ibm.com/infoce...rdatetime.html

i wanted to store the data as

insert into DB2INST1.A values ('2005-10-10T12:00:00.00 -05:30')
Reply With Quote
  #2 (permalink)  
Old 05-23-11, 09:20
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Quote:
Originally Posted by alwayssathya View Post
i wanted to store the data as
insert into DB2INST1.A values ('2005-10-10T12:00:00.00 -05:30')
Time zones have been added in DB2 10; up to version 9, DB2 stores dates, times and timestamps in "local clock" times only, without the possibility to remember time zones.
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
  #3 (permalink)  
Old 05-25-11, 00:35
alwayssathya alwayssathya is offline
Registered User
 
Join Date: Aug 2010
Location: Chennai India
Posts: 161
hi, thanks for the comment

DB2 10 is z/os ,but what im using is LUW.

so this will not be available in DB2 9.7 ,

is there any other way to use the TimeZone in the LUW editions ?
Reply With Quote
  #4 (permalink)  
Old 05-25-11, 07:35
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by alwayssathya View Post

is there any other way to use the TimeZone in the LUW editions ?
Depends on your definition of "using the timezone". You can store it as a decimal value of the format "HHMMSS", then you will be able to use it in datetime calculations.
Reply With Quote
  #5 (permalink)  
Old 05-26-11, 02:00
alwayssathya alwayssathya is offline
Registered User
 
Join Date: Aug 2010
Location: Chennai India
Posts: 161
thanks , the question here is i wanted to store
the timestamp in the format

'YYYY-MM-DD HH:MMS.ssss -ZZ:ZZ'

which should be like '2011-05-26 11:30:00.0000 -05:30'

is there any datatype which accept this format, As the LUW information Centre shows the link of datatype 'DateTime'

helpe me over come ....
Reply With Quote
  #6 (permalink)  
Old 05-26-11, 07:33
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Loop detected; start reading from the 2nd message in this thread.
Reply With Quote
  #7 (permalink)  
Old 05-26-11, 08:47
alwayssathya alwayssathya is offline
Registered User
 
Join Date: Aug 2010
Location: Chennai India
Posts: 161
good one .... thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On