DMCP interface  03.15_020
Date/Time Functions

Date/Time Functions. More...

Data Structures

struct  dt_t
 Date info structure. More...
 
struct  tm_t
 Time info structure. More...
 

Macros

#define PRINT_DT_TM_SZ   20
 String size that should be big enough to accommodate results of print_dmy_date() and print_clk24_time() functions.
 

Functions

const char * get_wday_shortcut (int day)
 Three character shortcut of day name. More...
 
const char * get_month_shortcut (int month)
 Three character shortcut of month name. More...
 
int julian_day (dt_t *d)
 Calculates Julian day for given date.
 
void julian_to_date (int julian_day, dt_t *d)
 Calculates date for given Julian day.
 
void print_dmy_date (char *s, int const sz, dt_t *dt, const char *prefix, int shortmon, char sep_arg)
 Formats date according to supplied and system flags. More...
 
void print_clk24_time (char *t, int const sz, tm_t *tm, int disp_sec, int disp_dow)
 Formats time according to supplied and system flags. More...
 

Detailed Description

Date/Time Functions.

Function Documentation

◆ get_month_shortcut()

const char* get_month_shortcut ( int  month)

Three character shortcut of month name.

Parameters
monthMonth number (1 = Jan)

◆ get_wday_shortcut()

const char* get_wday_shortcut ( int  day)

Three character shortcut of day name.

Parameters
dayDay number (0 = Mon)

◆ print_clk24_time()

void print_clk24_time ( char *  t,
int const  sz,
tm_t tm,
int  disp_sec,
int  disp_dow 
)

Formats time according to supplied and system flags.

Parameters
[out]tBuffer for resulting string
szSize of resulting string
tmTime to format
disp_sec(0/1) 1 = Seconds are displayed
disp_dow(0/1) 1 = Day of week is displayed

This function also honors system clk24 flag (accessed by system using set_flag_clk24/is_flag_clk24 functions)

◆ print_dmy_date()

void print_dmy_date ( char *  s,
int const  sz,
dt_t dt,
const char *  prefix,
int  shortmon,
char  sep_arg 
)

Formats date according to supplied and system flags.

Parameters
[out]sBuffer for resulting string
szSize of resulting string
dtDate to format
prefixOptional prefix string printed in front of date or NULL
shortmon(0/1) 0 - month as number, 1 - month as 3char shortcut
sep_argfield separator or 0 = default (/)

This function also honors system DMY flag (accessed by system using set_flag_dmy/get_flag_dmy functions).