diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-09 15:56:51 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2022-11-09 15:56:51 -0800 |
commit | eb7afede695259f073025b2db698194910bd2364 (patch) | |
tree | 429b603fa470ec7ad67f03958613484ea1bbe6d3 /adenosine-cli/src/lib.rs | |
parent | 9ca31fd3713ed9bcf1e1eb601c022afcb4fc4d74 (diff) | |
download | adenosine-eb7afede695259f073025b2db698194910bd2364.tar.gz adenosine-eb7afede695259f073025b2db698194910bd2364.zip |
cli: created_at timestamps; fix timeline command
Diffstat (limited to 'adenosine-cli/src/lib.rs')
-rw-r--r-- | adenosine-cli/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/adenosine-cli/src/lib.rs b/adenosine-cli/src/lib.rs index aed8480..ce08078 100644 --- a/adenosine-cli/src/lib.rs +++ b/adenosine-cli/src/lib.rs @@ -315,3 +315,10 @@ pub fn value_from_fields(fields: Vec<ArgField>) -> Value { } Value::Object(serde_json::map::Map::from_iter(map.into_iter())) } + +/// Helper to generate the current timestamp as right now, UTC, formatted as a string +pub fn created_at_now() -> String { + let now = time::OffsetDateTime::now_utc(); + now.format(&time::format_description::well_known::Rfc3339) + .unwrap() +} |