You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
478B

  1. use structopt::StructOpt;
  2. use chrono::prelude::*;
  3. #[derive(StructOpt, Debug)]
  4. #[structopt(author = env!("CARGO_PKG_AUTHORS"))]
  5. struct Opt {
  6. /// time to convert
  7. #[structopt(value_name = "HH:MM")]
  8. time: String,
  9. /// specify the date on which the time lies. defaults to today.
  10. #[structopt(long, short)]
  11. date: Option<NaiveDate>,
  12. }
  13. fn main() {
  14. let Opt { time, date } = Opt::from_args();
  15. tzconvert::convert("EST", "Europe/Brussels", &time, date);
  16. }