Greenwich Mean Time

  • I have an application that saves date and time as Greenwich Mean Time in the databse. We are on sql 7.0. We are using Crystal Enterprise to generate reports from this database. The reports show 6 hours time difference because of Greenwich Mean Time. How do I get the reports to show central time instead of Greenwich Mean Time?

    Your help will be greatly appreciated.

    Thanks in advance.

  • If all your programming will be "guaranteed" to run in your time zone, you could just use a DATEADD( HOUR, 6, <DateInDB> ) to display the correct time.

    If you want something more generic, here is code from Microsoft

    declare @deltaGMT int

    exec master.dbo.xp_regread

    'HKEY_LOCAL_MACHINE',

    'SYSTEM\CurrentControlSet\Control\TimeZoneInformation',

    'ActiveTimeBias',

    @DeltaGMT OUT

    Now you select with DATEADD( minute, @DeltaGMT, <YourDate> ) to get the proper results.

    Guarddata-

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply