MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_interval_to_ms

Function parse_interval_to_ms

nodedb-query/src/functions/datetime.rs:234–239  ·  view source on GitHub ↗

Parse an interval string like "1h", "5m", "1 hour", "30 seconds" to ms. Delegates to the canonical `nodedb_types::kv_parsing::parse_interval_to_ms`.

(s: &str)

Source from the content-addressed store, hash-verified

232///
233/// Delegates to the canonical `nodedb_types::kv_parsing::parse_interval_to_ms`.
234fn parse_interval_to_ms(s: &str) -> Option<i64> {
235 nodedb_types::kv_parsing::parse_interval_to_ms(s)
236 .ok()
237 .map(|ms| ms as i64)
238 .filter(|&ms| ms > 0)
239}

Callers 1

eval_time_bucketFunction · 0.70

Calls 1

okMethod · 0.45

Tested by

no test coverage detected