A Countdown Tracker That Handles DST, Timezones, and Calendar-Day Math Correctly "Days between two dates" sounds trivial, but (to - from) / 86400000 gives wrong answers around DST transitions and can even be off by a day depending on local timezone vs UTC. The correct approach: convert both dates to UTC midnight, subtract, divide. That way a "day" is always 24 hours and the answer is in calenda

A Countdown Tracker That Handles DST, Timezones, and Calendar-Day Math Correctly
SEN LLC·Dev.to··1 min read
D
Continue reading on Dev.to
This article was sourced from Dev.to's RSS feed. Visit the original for the complete story.