Availability | All terminals |
Description | This function fills in the date structure with the current date stored in the terminal's real-time clock. |
Syntax | void GetDate( 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 | The function fills in the structure, but has no return value. |
Remarks | The date can be set with the SetDate() function. |
Example |
// GetDate() / GetTime() example #include <stdio.h> #include "lib.h" void main( void ) { struct date d; struct time 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 ); } } |