summaryrefslogtreecommitdiffstats
path: root/adenosine-cli/src/lib.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-11-09 15:56:51 -0800
committerBryan Newbold <bnewbold@robocracy.org>2022-11-09 15:56:51 -0800
commiteb7afede695259f073025b2db698194910bd2364 (patch)
tree429b603fa470ec7ad67f03958613484ea1bbe6d3 /adenosine-cli/src/lib.rs
parent9ca31fd3713ed9bcf1e1eb601c022afcb4fc4d74 (diff)
downloadadenosine-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.rs7
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()
+}