Versions Compared

Key

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

...

Clk_TS_NTP_ToDateTime()

Anchor10513971051397Convert NTP timestamp to a date/time structure. Anchor10513981051398

Files

...

clk.h/clk.c

...

...

Prototype

...

classCode_Listing

...

rowspan5

...

...

Arguments

...

ts_ntp_sec Timestamp to convert (in seconds, UTC+00).

...

tz_sec Time zone offset (in seconds, ± from UTC).

...

p_date_time Pointer to variable that will receive the date/time structure.

...

Returned Values

...

DEF_OK, if timestamp successfully converted.

...

DEF_FAIL, otherwise.

...

Required Configuration

...

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

Notes / Warnings

Anchor10691501069150Timestamp (ts_ntp_sec) must be set for UTC+00 and should not include the time zone offset (tz_sec) since Clk_TS_NTP_ToDateTime() includes the time zone offset in its date/time calculation. Thus the time zone offset should not be applied before or after calling Clk_TS_NTP_ToDateTime(). Time zone field of the date/time structure (p_date_time->TZ_sec) is set to the value of the time zone argument (tz_sec). Anchor10514371051437

Example Usage

...

classCode_Listing

...

rowspan8

...