#include <stdio.h> // Needed for printf()
#include <time.h> // Needed for time data structures and functions
usingnamespace std;
int main()
{
time_t timer; // Define the timer
struct tm *tblock; // Define a structure for time block
// Get time of day
timer = time(NULL);
// Converts date/time to a structure
tblock = localtime(&timer);
// Output ASCII data/time
printf("Local time is: %s", asctime(tblock));
}