Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Good morning all,
I finally got my time code to a point where it works on all the platforms. This patch series does a couple things. First, it converts get_time to return {sec: i64, nsec: i32}. I made this change because many systems return negative values for times before 1/1/1970, 64 bit machines can return 64 bit second times, and linux can return subtimes with nanosecond resolution.
Second, I added pure-rust versions of strftime and strptime. The functionality is not complete to the c standard, but it's pretty thorough. I also added some helper functions that generate time strings for generating ctime, rfc822, and rfc 3339 formatted strings.
Please let me know if you have comments or want changes. I'm not completely sold on using strftime formats. It's standard, but you need to look at documentation to decipher what's going on. Perhaps instead we should copy how icu, C#, java or go does time string formatting.