// Using the asctime() and localtime() functions
#include <iostream>
#include <ctime>
using namespace std;

int main()
{
  time_t t;
  struct tm *timeinfo;

  time (&t);
  timeinfo = localtime (&t);
  cout << "Current date and time are\n" << asctime(timeinfo) << endl;

  return 0;
}
