Versions Compared

Key

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

...

Anchor10509831050983 Clk_IsDateTimeValid() Anchor10509841050984Determine if date/time structure is valid in Clock epoch. Anchor10509851050985

Files

...

clk.h/clk.c

...

Prototype

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

...

...


...

Arguments

...

1051000p_date_time

Pointer to variable that contains the date/time structure to validate.

...

Returned Values

...

DEF_YES, if date/time structure is valid. Anchor10510021051002

DEF_NO, otherwise. Anchor10510031051003

Required Configuration

...

None. Anchor10669281066928

Notes / Warnings

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

Example Usage

Anchor
10669661066966Listing - Clk_IsDateTimeValid() Example Usage

...

classCode_Listing

...

rowspan8

...

Listing - Clk_IsDateTimeValid() Example Usage


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

date_time.Month   =      9;

date_time.Day     =     18;

date_time.Hr      =     11;

date_time.Min     =     11;

date_time.Sec     =     11;

date_time.DayOfWk =      2;

date_time.DayOfYr =    291;

date_time.TZ_sec  = -18000;
  valid =

 
valid = Clk_IsDateTimeValid(&date_time);
if

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

} else {
    printf("Date/time is NOT valid");
}tr

}
Code Block
languagecpp
titleListing - Clk_IsDateTimeValid() Example Usage
linenumberstrue
CLK_DATE_TIME  date_time;
Anchor
10669341066934
Anchor
10669351066935
Anchor
10669361066936
Anchor
10669371066937
Anchor
10669381066938
Anchor
10669391066939
Anchor
10669401066940
Anchor
10669411066941
Anchor
10669421066942
Anchor
10669431066943
Anchor
10669441066944
Anchor
10669451066945
Anchor
10669461066946
Anchor
10669471066947
Anchor
10669481066948
Anchor
10669491066949
Anchor
10669501066950
Anchor
10669511066951
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)
Table Row (tr)