pub fn datetime(ctx: &ServiceContext) -> DatetimeExpand description
The HARDWARE real-time clock as calendar fields (InspectKernel query 11), with
Datetime::epoch_secs to turn it into epoch seconds.
This is the RTC, not the time service’s clock. The wall clock left the kernel for the
time service, which corrects it from the network or carries a floor across boots; none of
that reaches this call. So clock_source can answer ClockSource::Ntp or
ClockSource::Floor while this still reads the raw hardware.
A machine may not have one. On the boards with no RTC (the Pis, the VisionFive) the kernel
answers 0, which unpacks to all-zero fields - year 0, not today and not 1970 - and stays that
way after the network has supplied the time. On x86 it is the CMOS clock, unchecked. Check
clock_source rather than printing this; uptime_secs is the one that is always
meaningful.