diff options
author | Hendrik Sollich <hoodie@users.noreply.github.com> | 2019-11-24 14:21:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-24 14:21:30 +0100 |
commit | cae5c8b6857341e7ff7363d0a9de861489f6a2d2 (patch) | |
tree | cc52daf76d1d8d09d2294640e5d92ab4ffe79324 /examples | |
parent | 286e5e54b1b6078e990984a83fa0e6bbb8ddbb1a (diff) | |
parent | 1ef531f294308cfc9e5a52b3bd8a8279d41d1aeb (diff) |
Merge pull request #10 from strohel/timezone
Time zone handling: convert DateTime to UTC, NaiveDateTime to floating reference
Diffstat (limited to 'examples')
-rw-r--r-- | examples/tasks.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/tasks.rs b/examples/tasks.rs index b323123..e74f6f7 100644 --- a/examples/tasks.rs +++ b/examples/tasks.rs @@ -4,14 +4,13 @@ use chrono::*; fn main(){ let todo = Todo::new() - .starts(Local::now()) - .ends(Local::now()) + .starts(Local::now().naive_local()) + .ends(Local::now().naive_local()) .priority(12) .percent_complete(28) .status(TodoStatus::Completed) - .completed(&Local::now()) - .due(&Local::now()) - .due(&Local::now()) + .completed(Utc::now()) + .due(Local::now().with_timezone(&Utc)) .done(); println!("{}", todo.to_string()); |