Blek le Rat is a fast, simple template tool for the commandline
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.

mod.rs 338B

123456789101112131415161718
  1. use chrono::Local;
  2. use tera::Context;
  3. pub fn context() -> Context {
  4. let mut context = Context::new();
  5. context.insert("date", &date());
  6. context.insert("time", &time());
  7. context
  8. }
  9. fn date() -> String {
  10. format!("{}", Local::today().format("%F"))
  11. }
  12. fn time() -> String {
  13. format!("{}", Local::now().format("%X"))
  14. }