Availability | All terminals | ||||
Description | SetDate() sets the date in the terminal's real-time clock to the date in the date structure. | ||||
Syntax | int SetDate( struct date *datep ); | ||||
Arguments |
struct date *datepThe date structure is defined as follows:struct date { unsigned int da_year; // current year, 4 digits unsigned char da_day; // day of the month unsigned char da_mon; // month; 1 = January }; |
||||
Returns |
|
||||
Remarks | The date can be read back with the GetDate() function. | ||||
Example |
// SetDate() / SetTime() example #include <stdio.h> #include "lib.h" void main( void ) { struct date d = { .da_day = 3, .da_mon = 11, .da_year = 2028 }; struct time t = { .ti_hour = 8, .ti_min = 9, .ti_sec = 42 }; SetDate( &d ); SetTime( &t ); for(;;) { GetDate( &d ); GetTime( &t ); printf("\n%02d:%02d:%02d", t.ti_hour, t.ti_min, t.ti_sec); printf(" %02d/%02d/%04d", d.da_day, d.da_mon, d.da_year); Delay( 50 ); } } |