TimeSource

Trait TimeSource 

Source
pub trait TimeSource {
    // Required method
    fn now(&self) -> DateComponents;
}

Required Methods§

Source

fn now(&self) -> DateComponents

Get current date and time as components.

For embedded systems without a real-time clock, this may return:

  • Time from an external RTC chip
  • Time from NTP (if network available)
  • A fixed value (e.g., 2000-01-01 for systems without time)

Timezone offset is positive east of UTC, negative west:

  • UTC: 0
  • EST (UTC-5): -300
  • JST (UTC+9): +540

Implementors§