google / google/json_serializable.dart
Add microseconds to datetime serialization as a project wide option
- Dominant language
- Dart
- Stars
- 1.6k
- Forks
- 461
- Avg merge
- 45m
- Merged PRs (30d)
- 1
Description
The current serialization uses `toIso8601String`, which results in different behavior from the web and other platforms since the web does not have micro seconds informations.
so on the web you might get this: `2022-07-09T07:45:59.759`
while on other platforms you'll have: `2022-07-09T07:45:59.759316`
Using microSecondsSinceEpoch does not change the fact that the web does not have microsecond information but at least the format is the same.
I'm not sure if that can ever be an issue but it's the best reason I could find to warrant a feature to not have not write JsonKey on a datetime. I think at least micro_timestamp, timestamp and iso8601 could be supported.
Contributor guide
Assessment
This issue has not been assessed yet.