MCPcopy Create free account
hub / github.com/ccusage/ccusage / message_timestamp

Function message_timestamp

rust/crates/ccusage/src/adapter/codebuff/parser.rs:299–306  ·  view source on GitHub ↗
(message: &serde_json::Map<String, Value>)

Source from the content-addressed store, hash-verified

297}
298
299fn message_timestamp(message: &serde_json::Map<String, Value>) -> Option<crate::TimestampMs> {
300 timestamp_value(message.get("timestamp"))
301 .or_else(|| timestamp_value(message.get("createdAt")))
302 .or_else(|| {
303 object_field(message, "metadata")
304 .and_then(|metadata| timestamp_value(metadata.get("timestamp")))
305 })
306}
307
308fn parse_codebuff_chat_id_timestamp(chat_id: &str) -> Option<crate::TimestampMs> {
309 let (date, time) = chat_id.split_once('T')?;

Callers 1

load_chat_fileFunction · 0.85

Calls 2

timestamp_valueFunction · 0.85
object_fieldFunction · 0.70

Tested by

no test coverage detected