...
Required callback function that must be implemented in your application if CLK_CFG_EXT_EN
is DEF_ENABLED
in clk_cfg.h
(see section 3-1-1) in see Module Configuration) in order for the clock/calendar to be maintained by an external clock/timestamp mechanism.
...
The External timestamp is calculated by one of the following equations where:
Clock TS
Clock timestamp (in seconds, from UTC+00)
External TS
Converted External timestamp (in seconds)
Clock start year
Clock epoch start year (CLK_EPOCH_YR_START
)
External start year
External timestamp epoch start year
External end year
External timestamp epoch end year
Leap day count
Number of leap days between Clock epoch start year and External epoch start year
Seconds per day
Number of seconds per day (86400)
External TZ
Time zone offset applied to External timestamp (in seconds, from UTC+00)
When External epoch start year is less than Clock epoch start year (CLK_EPOCH_YR_START
):
External TS = Clock TS
+ [(((Clock start year - External start year) * 365)
+ leap day count) * seconds per day]
+ External TZ
Examples with a 32-bit External timestamp:
- Valid equivalent date to convert is before External epoch end year:
...