How to set current time to 8xx RTC through Linux application?

Song Sam samlinuxppc at yahoo.com.cn
Wed Jun 9 23:14:08 EST 2004


Hi,

I added 8xx RTC driver both on U-Boot and Linux
kernel.And I could set current time right under
U-Boot.But I have no idea on making it through Linux
application?I could read it with following code but
how to set it?

#include <time.h>

     time_t t;
     struct tm * tm;

     time(&t);
     tm=localtime(&t);

     printf("\nThe corrent time is : %02d.%02d.%02d
%02d:%02d:%02d\n",tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec);

Thanks in advance!

Sam

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list