//"LF_DateTime.h"
#include <time.h>
class CLF_DateTime
{
private:
struct tm *local;
time_t t;
char str[80];
public:
CLF_DateTime(int year, int month, int day,int hour, int min,int sec);
~CLF_DateTime();
void display();
};
#include "LF_DateTime.h"
#include <time.h>
#include <iostream>
using namespace std;
CLF_DateTime::CLF_DateTime(int year, int month, int day,int hour, int min,int sec)
{
local = new tm;
local->tm_year = year;
local->tm_mon = month;
local->tm_mday = day;
local->tm_hour =0;
local->tm_min =0;
local->tm_sec =0;
}
CLF_DateTime::~CLF_DateTime(void)
{
delete(local);
}
void CLF_DateTime::display()
{
strftime(str*,80,"%Y-%m-%d %H:%M:%S",local);
cout<<"Your input time is:"<<str<<endl;
}
int main()
{
CLF_DateTime str(2005,10 ,01 , 11,50,23);
str.display();
return 0;
}