15 lines
374 B
Rust
15 lines
374 B
Rust
use chrono::{DateTime, FixedOffset};
|
|
|
|
pub fn format_datetime(ts: DateTime<FixedOffset>) -> String {
|
|
ts.format("%A, %-d. %B %Y %R").to_string()
|
|
}
|
|
|
|
pub fn format_datetime_padded(ts: DateTime<FixedOffset>) -> String {
|
|
format!(
|
|
"{:>9}{}{:<9}{}",
|
|
ts.format("%A, "),
|
|
ts.format("%d. "),
|
|
ts.format("%B"),
|
|
ts.format(" %Y %R"),
|
|
)
|
|
}
|