Skip to main content

now_iso

Function now_iso 

Source
pub fn now_iso() -> String
Expand description

Returns the current time as an ISO 8601 UTC string.

§Examples

use ssg::now_iso;

let stamp = now_iso();
// Format is YYYY-MM-DDTHH:MM:SSZ — always 20 chars.
assert_eq!(stamp.len(), 20);
assert!(stamp.ends_with('Z'));
assert_eq!(&stamp[4..5], "-");