-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hey @telmich , I was just mucking around with GPT-3 and created a rust implementation of SUT:
// Import the DateTime crate
use chrono::{DateTime, Local, Timelike};
fn main() {
// Get the current time
let now: DateTime<Local> = Local::now();
// Calculate the total number of seconds in the day
let total_seconds: u32 = (((now.hour() * 3600) + (now.minute() * 60) + (now.second())) as f32 * (100000.0 / 86400.0)) as u32;
// Convert the total number of seconds to Simple Universal Time
let sut_hours: u32 = total_seconds / 10000;
let sut_minutes: u32 = (total_seconds / 100) % 100;
let sut_seconds: u32 = total_seconds % 100;
// Output the Simple Universal Time
println!("SUT {}:{}:{}", sut_hours, sut_minutes, sut_seconds);
}Can't believe it's 10 years since I wrote the C implementation!
Metadata
Metadata
Assignees
Labels
No labels