From eb7afede695259f073025b2db698194910bd2364 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 9 Nov 2022 15:56:51 -0800 Subject: cli: created_at timestamps; fix timeline command --- adenosine-cli/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'adenosine-cli/src/lib.rs') 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) -> 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() +} -- cgit v1.2.3