📅Date & Time

Daylight Saving Patterns

When and how clocks change for summer/winter time.

Explanation

DST shifts clocks forward in spring and back in autumn, usually by one hour, to extend daylight.

Examples

Spring Forward
Output
+1 hour (Spring)
Fall Back
Output
-1 hour (Autumn)

Code Examples

JavaScript
function isDST(date) {
  const jan = new Date(date.getFullYear(), 0, 1).getTimezoneOffset();
  const jul = new Date(date.getFullYear(), 6, 1).getTimezoneOffset();
  return date.getTimezoneOffset() < Math.max(jan, jul);
}

💡 Tips

  • Not all countries use DST
  • Shift usually happens at 02:00 local time
  • Southern hemisphere seasons are reversed

⚠️ Common Pitfalls

  • A 23-hour or 25-hour day once a year
  • Ambiguous hour when "falling back" (01:00 happens twice)