• Checks if two dates differ only by a timezone-like shift. Returns true if the difference is EXACTLY a whole number of hours (no variance in minutes/seconds/milliseconds) and within 23 hours. This helps detect timezone interpretation issues with datetime/datetime2 fields that don't store timezone information.

    Parameters

    • date1: Date

      The first date to compare

    • date2: Date

      The second date to compare

    Returns boolean

    true if the dates differ only by a whole-hour timezone shift (1-23 hours)

    Example

    // 6-hour timezone shift - returns true
    IsOnlyTimezoneShift(new Date('2025-12-25T10:30:45.123Z'), new Date('2025-12-25T16:30:45.123Z'));

    Example

    // Different by 1ms - returns false (real change)
    IsOnlyTimezoneShift(new Date('2025-12-25T10:30:45.123Z'), new Date('2025-12-25T16:30:45.124Z'));