Skip to main content

normalize_datetime

Function normalize_datetime 

Source
pub fn normalize_datetime(s: &str) -> Result<String, InvalidDatetimeError>
Expand description

Normalize a datetime string to canonical YYYY-MM-DDTHH:mm:ss.sssZ form.

The returned string:

  • is in UTC (any non-Z offset is converted, with correct day/month/year rollover via chrono);
  • has exactly three fractional-second digits, truncated (not rounded) from longer inputs to match the TS SDK’s Date.toISOString() output.