11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Library FunctionsLOCALTIMESynopsis#include struct tm * localtime (time_t * t)DescriptionThe localtime() function converts the time pointed to by t which is in seconds since 00:00:00 on Jan1, 1970, into a broken down time stored in a structure as defined in time.h. The routine localtime()takes into account the contents of the global integer time_zone. This should contain the number ofminutes that the local time zone is westward of Greenwich. Since there is no way under MS-DOS ofactually predetermining this value, by default localtime() will return the same result as gmtime().Example#include #include };char * wday[] = {"Sunday", "Monday", "Tuesday", "Wednesday","Thursday", "Friday", "Saturday"voidmain (void){time_t clock;struct tm * tp;}time(&clock);tp = localtime(&clock);printf("Today is %s\n", wday[tp->tm_wday]);158

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!