easy_date_time 0.1.0
easy_date_time: ^0.1.0 copied to clipboard
Timezone-aware DateTime for Dart. Supports local time by default, optional IANA timezones, intuitive operators, and standard JSON serialization. Perfect for Flutter and server-side applications.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2025-12-06 #
Initial release of easy_date_time package.
Core Features #
- EasyDateTime class - Timezone-aware DateTime implementation
- Local timezone as default - Works immediately without configuration
- TimeZones convenience API - 30+ common timezones with easy accessors
Constructors #
EasyDateTime()- From date/time componentsEasyDateTime.now()- Current timeEasyDateTime.utc()- UTC timeEasyDateTime.fromDateTime()- From standard DateTimeEasyDateTime.fromMillisecondsSinceEpoch()/fromMicrosecondsSinceEpoch()EasyDateTime.parse()/tryParse()- Parse ISO 8601 strings
Date Utilities #
dateOnly/startOfDay- Get date without time (00:00:00)endOfDay- Last moment of the day (23:59:59.999999)startOfMonth/endOfMonth- First/last moment of monthtomorrow/yesterday- Next/previous dayisToday/isTomorrow/isYesterday- Date checkingtoDateString()/toTimeString()- Formatted output
Timezone Operations #
inLocation()- Convert to specific timezoneinUtc()- Convert to UTCinLocalTime()- Convert to local timesetDefaultLocation()/clearDefaultLocation()- Global timezone config
Operators & Comparison #
- Arithmetic:
+,-with Duration - Comparison:
<,>,<=,>=,== - Methods:
isBefore(),isAfter(),isAtSameMoment()
Extensions #
- Duration:
1.days,2.hours,30.minutes, etc. - DateTime:
toEasyDateTime()for easy conversion
Serialization #
toJson()/fromJson()- ISO 8601 format- Compatible with json_serializable, freezed