JavaScript Date Object UTC Trap: Missing Data in Japan

2025-07-30

A seemingly simple JavaScript date filter caused the loss of backend data for Japanese users before 9 AM. The reason? `new Date('YYYY-MM-DD')` creates a date object at midnight UTC, which is 9 AM in Japan (UTC+9). Therefore, 'greater than January 1st' actually meant 'greater than 9 AM on January 1st'. The fix involved explicitly setting the time to midnight to avoid the UTC default.

Development Date