3 * - By John Hodge (thePowersGang)
11 #include <sys/types.h> // time_t
12 #include <stddef.h> // size_t
25 int tm_year; // 1900 based
31 #define CLOCKS_PER_SEC 1000
33 typedef signed long long clock_t;
35 //! Processor time used since invocation
36 extern clock_t clock(void);
38 //! Difference between two times in seconds
39 extern double difftime(time_t time1, time_t time0);
41 //! Convert a local time into the format returned by \a time
42 //! \note Also updates tm_wday and tm_yday to the correct values
43 extern time_t mktime(struct tm *timeptr);
45 //! Get the current calendar time
46 //! \note -1 is returned if the calendar time is not avaliable
47 extern time_t time(time_t *t);
52 //! Convert the time structure into a string of form 'Sun Sep 16 01:03:52 1973\n\0'
53 extern char *asctime(const struct tm *timeptr);
54 extern char *asctime_r(const struct tm *timeptr, char *buf);
56 //! asctime(localtime(timer))
57 extern char *ctime(const time_t *timer);
58 extern char *ctime_r(const time_t *timer, char *buf);
60 //! Convert \a timter into UTC
61 extern struct tm *gmtime(const time_t *timer);
62 extern struct tm *gmtime_r(const time_t *timer, struct tm *result);
64 extern struct tm *localtime(const time_t *timer);
65 extern struct tm *localtime_r(const time_t *timep, struct tm *result);
67 extern size_t strftime(char*s, size_t maxsize, const char*format, const struct tm*timeptr);
73 #include <libposix_time.h>