Versions Compared

Key

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

...

Anchor10509191050919 Clk_DateTimeMake() Anchor10509201050920Build a valid Clock epoch date/time structure. Anchor10509211050921

Files

...

clk.h/clk.c

...

...

Prototype

1051872 CLK_YR yr, CLK_MONTH month, CLK_DAY day, CLK_HR hr, CLK_MIN min, CLK_SEC sec, CLK_TZ_SEC tz_sec);
HTML Tablecode
classCode_Listing
Table Row (tr)
Table Cell (td)
rowspan5
Anchor
1051872
languagecpp
CPU_BOOLEAN  Clk_DateTimeMake (CLK_DATE_TIME  *p_date_time,
Anchor
10518731051873
Anchor
10518741051874
Anchor
10518751051875
Anchor
10518761051876
Anchor
10518771051877
Anchor
10518781051878
Anchor
10509251050925
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)

...


                               CLK_YR          yr,
                               CLK_MONTH       month,
                               CLK_DAY         day,
                               CLK_HR          hr,
                               CLK_MIN         min,
                               CLK_SEC         sec,
                               CLK_TZ_SEC      tz_sec);


Arguments

p_date_time

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

Anchor10699791069979yr yr

Year value [CLK_EPOCH_YR_START to CLK_EPOCH_YR_END).

anchormonth10700221070022 month

Month value [CLK_MONTH_JAN to CLK_MONTH_DEC].

Anchor10700231070023day day

Day value [1 to 31].

Anchor10518991051899hr hr

Hours value [0 to 23].

Anchor10519011051901min min

Minutes value [0 to 59].

Anchor10519031051903sec sec

Seconds value [0 to 60].

...

tz_sec

Time zone offset (in seconds, ± from UTC) [-43200 to 43200].

...

Returned Values

...

DEF_OK

, if date/time structure successfully returned.

...

1051995DEF_FAIL

, otherwise.

...

Required Configuration

...

None. Anchor10509411050941

Notes / Warnings

...

1052015Date/time structure (p_date_time) must be representable in Clock timestamp. Thus date to convert must be greater than or equal to CLK_EPOCH_YR_START and less than CLK_EPOCH_YR_END.

Example Usage

Anchor
10509601050960Listing - Clk_DateTimeMake() Example Usage

...

classCode_Listing

...

rowspan8

...

Listing - Clk_DateTimeMake() Example Usage


CPU_BOOLEAN
valid;   /*
    valid;
 
                                  /* 2010/09/18   11:11:11 UTC-05:00  */
valid =

valid = Clk_DateTimeMake(&date_time, 2010, 9, 18, 11, 11, 11, -18000);
if

if (valid == DEF_OK)
{
 {
    printf("Date/time successfully created");
} else {

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

}
Code Block
languagecpp
titleListing - Clk_DateTimeMake() Example Usage
linenumberstrue
CLK_DATE_TIME  date_time;
Anchor
10520411052041
Anchor
10631691063169
Anchor
10631741063174
Anchor
10631751063175
Anchor
10631761063176
Anchor
10520951052095
Anchor
10520961052096
Anchor
10520971052097
Anchor
10520861052086
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)