/* Orion Lawlor's Short UNIX Examples, olawlor@acm.org 2004/3/5

Shows how to use the <time.h> routines localtime and asctime.
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>

int main(){ 
	char buf[100];
	struct timeval tv;
	time_t tt;
	struct tm tm;
	
	gettimeofday(&tv,0);
	tt=tv.tv_sec; /* seconds since 1970 */
	localtime_r(&tt, &tm);
	printf("It's currently year %d, month %d, day %d\n",
		1900+tm.tm_year, 1+tm.tm_mon, tm.tm_mday);

        return(0);
}
/*<@>
<@> ******** Program output: ********
<@> It's currently year 2008, month 4, day 21
<@> */
