system time on sql server is wrong?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • thomasamillergoogle@yahoo.com

    system time on sql server is wrong?

    Hello,
    My sql server 2000 database is on a shared server that I have
    absolutely no control over.

    When i run query select getdate() it is reporting the wrong time!

    I am pretty sure that the sql admin changed the date on the server last
    night and now this is happening.

    Is this possible. Shouldn't getdate() ALWAYS report back the date time
    in my LOCAL time zone?

  • Erland Sommarskog

    #2
    Re: system time on sql server is wrong?

    (thomasamillerg oogle@yahoo.com ) writes:[color=blue]
    > My sql server 2000 database is on a shared server that I have
    > absolutely no control over.
    >
    > When i run query select getdate() it is reporting the wrong time!
    >
    > I am pretty sure that the sql admin changed the date on the server last
    > night and now this is happening.
    >
    > Is this possible. Shouldn't getdate() ALWAYS report back the date time
    > in my LOCAL time zone?[/color]

    No. getdate() will report the time in the server's time zone.

    And as far as I know, getdate() follows the system time. That is, if system
    time is adjusted, then getdate() follows suit.

    If you have access to xp_cmdshell (since this is a shared server, I suspect
    you have not), you can try:

    exec master..xp_cmds hell 'time /T'

    to view the system time without SQL Server in between.


    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Books Online for SQL Server SP3 at
    Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.

    Comment

    Working...