The First Place Seeing the New Year

  • Comments posted to this topic are about the item The First Place Seeing the New Year

  • this might not be accurate in all cases, especially if the UTC offset has a non-numeric component (such as '+05:30').

  • Sheikh Saif wrote:

    this might not be accurate in all cases, especially if the UTC offset has a non-numeric component (such as '+05:30').

    the correct answer always works correctly - and it is accurate.

  • Actually - none of the answers are correct because you also need to take into consideration DST.  The earliest time zone offset is +14:00 and both 'Samoa Standard Time' and 'Line Islands Standard Time' currently use that offset in SQL Server - however Samoa no longer observes DST so its offset is actually '+13:00' - and therefore 1 hour behind.

    I would use the following:

    SELECT TOP (1)
    tzi.name
    , tzi.current_utc_offset
    , date_time_at_utc = cast('2024-01-01' AS datetime2) AT TIME ZONE tzi.name AT TIME ZONE 'UTC'
    FROM sys.time_zone_info tzi
    ORDER BY
    date_time_at_utc
    , tzi.is_currently_dst;

    That gives us '2023-12-31 10:00:00.0000000 +00:00' as the earliest UTC time for the new year - and that time zone is 'Line Islands Standard Time'.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 4 posts - 1 through 3 (of 3 total)

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