struct tm {
int tm_sec; /* seconds, range 0 to 59 */
int tm_min; /* minutes, range 0 to 59 */
int tm_hour; /* hours, range 0 to 23 */
int tm_mday; /* day of the month, range 1 to 31 */
int tm_mon; /* month, range 0 to 11 */
int tm_year; /* The number of years since 1900 */
int tm_wday; /* day of the week, range 0 to 6 */
int tm_yday; /* day in the year, range 0 to 365 */
int tm_isdst; /* daylight saving time */
};
#include <stdio.h>
#include <time.h>
int main ()
{
time_t rawtime;
struct tm *info;
time( &rawtime );
info = localtime( &rawtime );
printf("Current local time and date: %s", asctime(info));
printf("%02d/%02d/%d %02d:%02d:%02d\n", info->tm_mon+1, info->tm_mday, info->tm_year+1900, info->tm_hour, info->tm_min, info->tm_sec);
return(0);
}