-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support strftime and strptime equivalent for formatting and parsing #190
Support strftime and strptime equivalent for formatting and parsing #190
Conversation
…tialization Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
This basically adds strftime to hifitime. Will now work on the parser of the same kind. This may be a notch more challenging. Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
Codecov ReportBase: 79.83% // Head: 77.67% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #190 +/- ##
==========================================
- Coverage 79.83% 77.67% -2.16%
==========================================
Files 10 14 +4
Lines 2886 3602 +716
==========================================
+ Hits 2304 2798 +494
- Misses 582 804 +222
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
Hello Chris,
thanks! I'll test this new content when I have a little time. Wow this is very good Chris. This will probably help simplify operations like here where I need to parse an Epoch from a custom format, and generate it a few lines above |
This should make for cleaner imports
Also refactored the formatting structures to be shorter
…year-initialization-and-formatting' into 182-support-day-of-year-initialization-and-formatting
…-formatting Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
+ Removed the `efmt` feature since the library size barely changes with it. + Add IAI / Cachegrind based benchmarks.
For #182, this adds support for the computation of Day of Year (e.g.
059
for the 29th of February 2000). This also supports initialization of an Epoch provided the year, the Day of Year, and the time scale.For #181, this adds support for custom formatting rules, as well as providing a number of standard formats like RFC2820. This also introduced the month name structure. This structure is used strictly for formatting and has no other use. It is therefore extremely limited in scope.
Notes on the implementation of the parsing: if the week day is provided in the format and the string to parse leads to an Epoch whose week day is different from the one provided, the parsing will return an error.
@gwbres I've added you as a reviewer since you've contributed a lot recently. I'll be self-reviewing the changes proposed here anyway, but a second pair of eyes is always useful.
Remaining TODOs:
from_str
to the parsing method above (I'm unsure about this because the currentfrom_str
is quite well optimized so there may be some performance degradation if the switch is made).