/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* a sample program that return local time. */
#include <stdio.h>
#include <time.h>

int main() {
    struct tm *ptr;
    time_t lt;
    
    lt = time(NULL);       //return system time
    printf("time(NULL) = %d\n", lt);
    time(&lt);             //pass system time
    printf("time(&lt) = %d\n", lt);
    ptr = localtime(&lt);  // return time in the form of tm structure
    printf(asctime(ptr));
}
