/* ========================================================================== */ /* */ /* RTC.c */ /* (c) 2001 ICPDAS:Eva Li */ /* */ /* Description */ /* */ /* ========================================================================== */ #include #include void main() { int year,month,day,hour,min,sec,wday; InitLib(); SetDate(2006,1,12); /*set the system date for RTC*/ SetTime(15,35,50); /*set the system time for RTC*/ SetWeekDay(4); /*set the system weekday for RTC*/ GetDate(&year,&month,&day); /*get the system date from RTC*/ GetTime(&hour,&min,&sec); /*get the system time from RTC*/ wday=GetWeekDay(); Print("Date=%02d/%02d/%04d(%d) Time=%02d:%02d:%02d\n\r", month,day,year,wday,hour,min,sec); }