locked
Accounting Datetime disrepancy between file-logs and SQL logs RRS feed

  • Question

  • We've been loggin to log-files while setting up the NPS NAP solution.
    The log files (database compatible) is showing the correct time.
    However the SQL log contains a timestamp that is two hours earlier.
    Example:
    The file log entry says 10:14, while the SQL time entry says 08:14.

    The NPS server OS is English, with Norwegian regional settings - GMT +1 +DST. All Regional settings are set to norwegian and applied to services & default accounts.

    The SQL Server is a Windows 2003, with SQL 2005. English OS, with Norwegian Timezones & Regional settings (including defaults).
    The SQL Server default collation is "Danish_Norwegian_CI_AS". We created the database with some "latin" collation - but sine the time was off, we changed the DB collation to "Danish_Norwegian_CI_AS" as well.

    Still having the same issues.
    Any ideas?

    Sincerly, Jon E. Carlsen
    Wednesday, October 15, 2008 8:27 AM

Answers

  • Allright - replaced GETUTCDATE with GETDATE instead - problem solved.


    Sincerly, Jon E. Carlsen
    • Marked as answer by Jon E. Carlsen Wednesday, October 15, 2008 9:02 AM
    Wednesday, October 15, 2008 9:02 AM

All replies

  • Ah, oh - now I see ... GETUTCTIME. Hm.

    The SP from the SQL:

    /*

    All RADIUS attributes written to the ODBC format logfile are declared here.

    One additional attribute is added: @record_timestamp.

    The value of @record_timestamp is the UTC time the record was inserted in the database.

    Refer to IAS-Formatted Log Files in Online Help on www.technet.com for information on interpreting these values.

    */

    DECLARE @record_timestamp datetime

    SET @record_timestamp = GETUTCDATE()

    INSERT accounting_data

    SELECT

    @record_timestamp,

    .....

    .....

    I'll do some reading I think. :)


    Sincerly, Jon E. Carlsen
    Wednesday, October 15, 2008 8:39 AM
  • Okai, I'm confused:
    GETUTCDATE (Transact-SQL)

    Returns the datetime value that represents the current UTC time (Coordinated Universal Time or Greenwich Mean Time). The current UTC time is derived from the current local time and the time zone setting in the operating system of the computer on which the instance of Microsoft SQL Server is running.

    Link http://msdn.microsoft.com/en-us/library/ms178635(SQL.90).aspx

    I know, this is probably best asked over at some SQL subforum, but I'll take my chance here right now:
    Shouldnt it return the correct timezone for me then?


    Sincerly, Jon E. Carlsen
    Wednesday, October 15, 2008 8:43 AM
  • Allright - replaced GETUTCDATE with GETDATE instead - problem solved.


    Sincerly, Jon E. Carlsen
    • Marked as answer by Jon E. Carlsen Wednesday, October 15, 2008 9:02 AM
    Wednesday, October 15, 2008 9:02 AM