OxL Reference

method TimeOfDay.fmt

Formats with a pattern (HH:mm); an empty pattern is ISO 8601.

Example:

oxl✓ checked in CI
use std.time { TimeOfDay }

fn main() io {
  print(TimeOfDay{ hour: 18, minute: 5 }.fmt("HH:mm"))
}
Output
18:05
pub(api) fn fmt(pattern: str) -> str

Complexity. O(len(pattern)).

Since. 1.0.0-beta

Parameters

NameType
patternstr

Returns

str

Effects

none declared (pure unless the body says otherwise)

Defined in: std/time/time.oxl:1225

See also