I’m developing a mobile application using Flutter for task management that requires precise timing, particularly during the transition from daylight saving time (DST) to standard time. I’m using UTC to log events and tasks. Despite this, I face issues with time conversion and comparison during DST changes. I need to ensure events are accurately tracked through these transitions.
Specific Problem:
Consider a task completed at 6:00 AM UTC+2. After the DST change, the device clock shows 5:00 AM UTC+1. I want to prevent the app from incorrectly marking this task as incomplete due to the time discrepancy.
Attempts:
- Maintaining all timestamps in UTC and converting them for display purposes. However, this approach has led to confusion during time comparisons.
- Checking for DST activation during event saving, which has not fully resolved the issue.
Question:
How can I handle the transition periods of DST in my application to ensure accurate time tracking and task status without discrepancies?
Coder Coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.