today_yyyymmdd_utc

Function today_yyyymmdd_utc 

Source
pub fn today_yyyymmdd_utc() -> String
Expand description

What: Return today’s UTC date formatted as YYYYMMDD using only the standard library.

Inputs:

  • None (uses current system time).

Output:

  • Returns a string in format YYYYMMDD representing today’s date in UTC.

Details:

  • Uses a simple conversion from Unix epoch seconds to a UTC calendar date.
  • Matches the same leap-year logic as ts_to_date.
  • Falls back to epoch date (1970-01-01) if system time is before 1970.