diff options
| author | sigoden <sigoden@gmail.com> | 2023-03-05 06:17:43 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-05 06:17:43 +0800 |
| commit | 822f0eed9429f71524e739352da3f76d604071d5 (patch) | |
| tree | 30787848b82dba796b0a7fc54069f72012c268d9 /src/utils.rs | |
| parent | 7a60a3636780974dd4dfc7e73e4df0d5ab2f7f93 (diff) | |
| download | aichat-822f0eed9429f71524e739352da3f76d604071d5.tar.gz | |
refactor: message record format (#12)
```
i am excited
--------
😃💥🎉
--------
```
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs index cb5d1f9..b248d92 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,4 +1,5 @@ use anyhow::{anyhow, Result}; +use chrono::prelude::*; use copypasta::{ClipboardContext, ClipboardProvider}; use std::io::{stdout, Write}; @@ -17,3 +18,8 @@ pub fn paste() -> Result<String> { let mut ctx = ClipboardContext::new().map_err(|err| anyhow!("{err}"))?; ctx.get_contents().map_err(|err| anyhow!("{err}")) } + +pub fn now() -> String { + let now = Local::now(); + now.to_rfc3339_opts(SecondsFormat::Secs, false) +} |
