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 > issue to current time

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-30-10, 10:29
alanhome alanhome is offline
Registered User
 
Join Date: Mar 2010
Posts: 9
issue to current time

Hello all,

I have a problem when I use current time - current timezone in my SQL statement. I got the result e.g. 17:26, but correct answer is 16:27 which is my pc system time.

I have no idea why

can anyone help me on this ?

thanks
Reply With Quote
  #2 (permalink)  
Old 07-30-10, 10:44
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,195
In general, divide and conquer to solve a problem.

First see the values of current time and current timezone separately.
Reply With Quote
  #3 (permalink)  
Old 07-30-10, 11:07
alanhome alanhome is offline
Registered User
 
Join Date: Mar 2010
Posts: 9
thanks for reply.
I got 19:27 if I use current time, but now is 16:27, 3 hours later
I got 20000 by using current time and my database uses UTC.

Now I use current time - current timezone - 1 Hour to get local time, but it is hard code
How can I fix it?

thanks
Reply With Quote
  #4 (permalink)  
Old 07-30-10, 12:01
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
Thumbs down

Quote:
Originally Posted by alanhome View Post
thanks for reply.
I got 19:27 if I use current time, but now is 16:27, 3 hours later
I got 20000 by using current time and my database uses UTC.

Now I use current time - current timezone - 1 Hour to get local time, but it is hard code
How can I fix it?

thanks
Talk to DBA how they are install DB2 system.
They are made a mistake.

Lenny
Reply With Quote
  #5 (permalink)  
Old 07-30-10, 12:12
alanhome alanhome is offline
Registered User
 
Join Date: Mar 2010
Posts: 9
thanks, I will .
Reply With Quote
  #6 (permalink)  
Old 07-30-10, 14:26
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Current time and current timezone are the values on the server. If the server is using GMT, then subtracting current timezone only gives you the local time of the server, not the workstation.

Andy
Reply With Quote
Reply

Tags
current time

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