diff --git a/README.md b/README.md index 4af99cc..b420b10 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ It is possible to access directly the sqlite database using ## Specifying times Some arguments accept a time as value, like `t in`'s `--at` or `t d --start`. -This are the accepted formats: +These are the accepted formats: **Something similar to ISO format** will be parsed as a time in the computer's timezone. diff --git a/src/error.rs b/src/error.rs index e381da1..291d1ca 100644 --- a/src/error.rs +++ b/src/error.rs @@ -27,7 +27,33 @@ pub enum Error { #[error("Couldn't parse yaml file at: {path}\nwith error: {error}")] YamlError{ path: PathBuf, error: serde_yaml::Error}, - #[error("Could not understand '{0}' as a date format.")] + #[error("Could not understand '{0}' as a date format. Some options are: + +Something similar to ISO format will be parsed as a time in the computer's +timezone. + +* '2021-01-13' a date +* '2019-05-03 11:13' a date with portions of a time + +ISO format with offset or UTC will be parsed as a time in the specified +timezone. Use 'Z' for 'UTC' and an offset for everything else + +* '2021-01-13Z' +* '2005-10-14 19:20:35+05:00' + +something that looks like an hour will be parsed as a time in the current +day in the computer's timezone. Add 'Z' or an offset to specify the timezone. + +* '11:30' +* '23:50:45' (with seconds) + +some human times, for now restricted to time ago: + +* 'an hour ago' +* 'a minute ago' +* '50 min ago' +* '1h30m ago' +* 'two hours thirty minutes ago'")] DateTimeParseError(String), #[error("IOError: {0}")]