Versions Compared

Key

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

...

Anchor10492661049266 Clk_GetDateTime() Anchor10492671049267Get current Clock timestamp as a date/time structure. Anchor10492681049268

Files

...

clk.h/clk.c

...

Prototype

tr
HTML Tablecode
classCode_Listing
Table Row (tr)
Table Cell (td)
rowspan5
Anchor
10492721049272
languagecpp
CPU_BOOLEAN  Clk_GetDateTime (CLK_DATE_TIME  *p_date_time);
Table Row (tr)
Table Row (tr)
Table Row (tr)

...


...

Arguments

Anchor10492831049283p_date_time

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

...

Returned Values

...

10500971050097DEF_OK, if date/time structure is valid. Anchor

10492851049285DEF_FAIL, otherwise. Anchor10492861049286

Required Configuration

...

None. Anchor10662591066259

Notes / Warnings

Anchor10662601066260Clock time zone offset is used to calculate the local date/time (p_date_time) returned. Thus local date/time is returned as UTC+TZ, where Clock time zone offset (TZ) is returned as local time zone offset (p_date_time->TZ_sec).

Example Usage

Anchor
10493071049307Listing - Clk_GetDateTime() Example Usage

...

classCode_Listing

...

rowspan8

...

Listing - Clk_GetDateTime() Example Usage


CPU_BOOLEAN
valid;   valid =
    valid;
 
valid = Clk_GetDateTime(&date_time);
if

if (valid == DEF_OK)
{
 {
    printf("Time = %u:%u:%u\n\r", date_time
->Hr
.Hr, date_time
->Min
.Min, date_time
->Sec
.Sec);
} else {

} else {
    printf("Clock Get Date/time error\n\r");
}tr

}
Code Block
languagecpp
titleListing - Clk_GetDateTime() Example Usage
linenumberstrue
CLK_DATE_TIME  date_time;
Anchor
10501211050121
Anchor
10501421050142
Anchor
10501491050149
Anchor
10501811050181
Anchor
10501821050182
Anchor
10501831050183
Anchor
10501841050184
Anchor
10501281050128
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)