Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2010
    Posts
    9

    Unanswered: 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

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    In general, divide and conquer to solve a problem.

    First see the values of current time and current timezone separately.

  3. #3
    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

  4. #4
    Join Date
    Jul 2009
    Location
    NY
    Posts
    963

    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

  5. #5
    Join Date
    Mar 2010
    Posts
    9
    thanks, I will .

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •