diff --git a/examples/auth.rs b/examples/auth.rs index 4819859ce..9ed9e37db 100644 --- a/examples/auth.rs +++ b/examples/auth.rs @@ -1,8 +1,10 @@ extern crate "yup-oauth2" as oauth2; extern crate "yup-hyper-mock" as mock; extern crate hyper; +extern crate chrono; extern crate getopts; +use chrono::{Local}; use getopts::{HasArg,Options,Occur,Fail}; use std::os; use std::old_io::{File, FileMode, FileAccess}; @@ -53,7 +55,7 @@ fn main() { given scopes. This is not a test !\n\ You have time until {} to do that. Do not terminate the program until you deny or grant access !", - pi.user_code, pi.verification_url, pi.expires_at); + pi.user_code, pi.verification_url, pi.expires_at.with_timezone(&Local)); } } @@ -64,6 +66,7 @@ fn main() { .retrieve_token(client, &client_id, &client_secret, &m.free) { println!("Authentication granted !"); println!("You should store the following information for use, or revoke it."); + println!("All dates are given in UTC."); println!("{:?}", t); } else { println!("Invalid client id, invalid scope, user denied access or request expired"); diff --git a/src/device.rs b/src/device.rs index 9fefa9f6c..1c96e8c1a 100644 --- a/src/device.rs +++ b/src/device.rs @@ -8,7 +8,7 @@ use hyper; use hyper::header::ContentType; use url::form_urlencoded; use itertools::Itertools; -use rustc_serialize::{self, json}; +use rustc_serialize::json; use chrono::{DateTime,UTC}; use common::{Token, AuthenticationType}; diff --git a/src/refresh.rs b/src/refresh.rs index d1bb6c084..4838ffe60 100644 --- a/src/refresh.rs +++ b/src/refresh.rs @@ -4,7 +4,7 @@ use std::time::Duration; use chrono::UTC; use hyper; use hyper::header::ContentType; -use rustc_serialize::{self, json}; +use rustc_serialize::json; use url::form_urlencoded; use super::Token;