Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Clk_DateTimeToTS_NTP()

Anchor10514571051457Convert a date/time structure to NTP timestamp. Anchor10514581051458

Files

...

clk.h/clk.c

...

Prototype

...

classCode_Listing

...

rowspan5

...

Arguments

...

p_ts_ntp_sec Pointer to variable that will receive the NTP timestamp:

...

10673931067393 In seconds UTC+00, if no errors;
CLK_TS_SEC_NONE, otherwise. Anchor10514731051473

p_date_time Date/time structure to convert.

...

Returned Values

...

DEF_OK, if date/time structure successfully converted.

...

DEF_FAIL, otherwise.

...

Required Configuration

...

10616431061643Available only if CLK_CFG_NTP_EN is DEF_ENABLED in clk_cfg.h (see section 3-1-1).anchor10514781051478

Notes / Warnings

...

Date/time structure (p_date_time) must be representable in NTP timestamp. Thus date to convert must be greater than or equal to CLK_NTP_EPOCH_YR_START and less than CLK_NTP_EPOCH_YR_END. Date/time should be set to local time with correct time zone offset (p_date_time->TZ_sec). Clk_DateTimeToTS_NTP() removes the time zone offset from the date/time to calculate and return an NTP timestamp at UTC+00. Anchor10698441069844

Example Usage

...

classCode_Listing

...

rowspan8

...