parent
5c0e250a36
commit
74342dcc82
@ -0,0 +1 @@
|
||||
pub mod time;
|
||||
@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
/// Super naive implementation. Just a quick and dirty to get a string
|
||||
pub fn tz_offset_to_string(tz_offset_seconds: i32) -> String {
|
||||
if tz_offset_seconds == 3600 * -6 {
|
||||
return "Central".to_string();
|
||||
}
|
||||
else if tz_offset_seconds == 3600 * -5 {
|
||||
return "Eastern".to_string();
|
||||
}
|
||||
else if tz_offset_seconds == 3600 * -7 {
|
||||
return "Pacific".to_string();
|
||||
}
|
||||
else if tz_offset_seconds < 0 {
|
||||
return format!("UTC{}", tz_offset_seconds).to_string();
|
||||
}
|
||||
|
||||
format!("UTC+{}", tz_offset_seconds).to_string()
|
||||
}
|
||||
Loading…
Reference in new issue