Skip to content

Instantly share code, notes, and snippets.

@nicolandu
Created July 17, 2024 19:04
Show Gist options
  • Save nicolandu/904a4ea6ed7fd6086fe78f6be7080cf3 to your computer and use it in GitHub Desktop.
Save nicolandu/904a4ea6ed7fd6086fe78f6be7080cf3 to your computer and use it in GitHub Desktop.
A special, minified Rust clock that prominently displays a particular day of the week.
use {chrono::{prelude::{*,Weekday::Wed as W},offset as o},std::thread::sleep,std::time::Duration as d};fn main(){loop{let u=o::Utc::now();let l=o::Local::now();let t=match(u.weekday(),l.weekday()){(W,W)=>("",""),(W,_)=>("",", BUT NOT FOR YOU"),(_,W)=>("NOT",", BUT IT IS FOR YOU"),(_,_)=>("NOT","")};println!("{} ({}) -- IT IS {}WEDNESDAY, MY DUDES{}",u.format("%Y-%m-%d %H:%M:%SZ"),l.format("%H:%M:%SL"),t.0,t.1);sleep(d::from_secs(1));}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment