Merge pull request #213 from lancecarlson/master

Update README.md
This commit is contained in:
Brandon W Maister 2018-01-29 22:12:05 -05:00 committed by GitHub
commit d403eeb43a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -236,6 +236,10 @@ assert_eq!(dt.to_string(), "2014-11-28 12:00:09 UTC");
assert_eq!(dt.to_rfc2822(), "Fri, 28 Nov 2014 12:00:09 +0000"); assert_eq!(dt.to_rfc2822(), "Fri, 28 Nov 2014 12:00:09 +0000");
assert_eq!(dt.to_rfc3339(), "2014-11-28T12:00:09+00:00"); assert_eq!(dt.to_rfc3339(), "2014-11-28T12:00:09+00:00");
assert_eq!(format!("{:?}", dt), "2014-11-28T12:00:09Z"); assert_eq!(format!("{:?}", dt), "2014-11-28T12:00:09Z");
let now = Utc::now();
// Will display today's date with nanoseconds
println!("{:?}", now); // 2018-1-24T12:00:00.000000000Z
``` ```
Parsing can be done with three methods: Parsing can be done with three methods: