summaryrefslogtreecommitdiffstats
path: root/src/readline.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-07 13:44:43 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-07 13:44:43 -0500
commit08246280e5707cc6a3153efc9648e33d2e122054 (patch)
treed9bc45daedc70357417bb1d81a48aaf436176155 /src/readline.rs
parent932a16d8fe617821a40332ec32ed9d5f682ca0dc (diff)
downloadnbsh-08246280e5707cc6a3153efc9648e33d2e122054.tar.gz
nbsh-08246280e5707cc6a3153efc9648e33d2e122054.zip
move from chrono to time
chrono seems a bit unmaintained, and has a more awkward api
Diffstat (limited to 'src/readline.rs')
-rw-r--r--src/readline.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/readline.rs b/src/readline.rs
index 8b3c847..aef817a 100644
--- a/src/readline.rs
+++ b/src/readline.rs
@@ -57,6 +57,7 @@ impl Readline {
&self,
out: &mut textmode::Output,
focus: bool,
+ offset: time::UtcOffset,
) -> anyhow::Result<()> {
let mut pwd = std::env::current_dir()?.display().to_string();
let home = std::env::var("HOME")?;
@@ -74,7 +75,9 @@ impl Readline {
}
let id = format!("{}@{}", user, hostname);
let idlen: u16 = id.len().try_into().unwrap();
- let time = chrono::Local::now().format("%H:%M:%S").to_string();
+ let time = crate::format::time(
+ time::OffsetDateTime::now_utc().to_offset(offset),
+ );
let timelen: u16 = time.len().try_into().unwrap();
out.move_to(self.size.0 - 2, 0);