This repository was archived by the owner on May 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
002 timestamp timezone handling
Morgan Joyce edited this page Jan 13, 2025
·
1 revision
- Status: Proposed
- Date: 2025-01-13
The Dev Notes CLI tool currently has an inconsistency in its timestamp handling:
-
File Names: Uses UTC (
toISOString())- Example:
2025-01-13_slack communication.md(UTC date) - Can show "next day" for evening hours in negative UTC offset zones
- Example:
-
Content Timestamp: Uses local time
- Example:
Created: 2025-01-13 18:52:49(local time) - Matches user's local expectations
- Example:
This distinction between filename and content timestamps is a crucial detail I missed in the original draft. It makes the need for standardization even more apparent since we currently have mixed timezone handling within the same note. For example, at 6:52 PM CST:
- Filename:
2025-01-14_example.md(UTC already rolled to next day) - Content:
Created: 2025-01-13 18:52:49(local CST time)
We have two potential approaches:
- Use
toLocaleDateString()andtoLocaleTimeString() - Filenames and timestamps match user's local expectations
- Different users see different timestamps for same moment
- Keep current UTC approach
- Add explicit UTC indicator in timestamps
- Document timezone handling clearly
- Consider showing local time alongside UTC
- User experience and intuitive behavior
- Cross-timezone collaboration needs
- Git commit history alignment
- File sorting consistency
- How important is cross-timezone collaboration?
- Should filenames match local time while content timestamps use UTC?
- Do we need to support timezone-aware searching/filtering?
This impacts both user experience and potential future features like note synchronization or collaborative editing.
- Date: [TBD]
- Chosen Approach: [TBD]
[To be filled after decision]
Positive:
- Intuitive timestamps for single-user scenarios
- Filenames match user's workday
- Simpler mental model for local users
Negative:
- Potential sorting inconsistencies across timezones
- Harder to determine exact moment in collaborative scenarios
- May complicate future sync features
Positive:
- Consistent ordering across all timezones
- Unambiguous timestamps for collaboration
- Aligns with Git timestamp handling
Negative:
- Counter-intuitive file dating for evening work
- Requires users to think in UTC
- May need additional local time display
Implementation considerations:
- Date/time formatting consistency
- Migration strategy for existing notes
- Configuration options for timestamp display
- Documentation updates