Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Method to get local UTC offset at a given datetime (#217)
This implementation should work on Windows, Mac, Linux, and Solaris. As Redox is *nix, it should work there as well. `OffsetDateTime::now_local()` returns a value with the local offset. `UtcOffset::local_offset_at(OffsetDateTime)` and `UtcOffset::current_local_offset()` have also been implemented. This necessarily requires syscalls, and as such `#![forbid(unsafe_code)]` has been changed to `#![deny(unsafe_code)]`. It must be explicitly `#[allow]`ed in every location it is used, along with a general message describing why the usage is safe. Co-authored-by: Hroi Sigurdsson <hroi@asdf.dk>
- Loading branch information
Showing
5 changed files
with
237 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters