📄 datetime.h
字号:
// DateTime.h: interface for the DateTime class.
//
//////////////////////////////////////////////////////////////////////
#include <iostream>
#include <strstream>
#include "Date.h"
#include "Time.h"
using namespace std;
class DateTime
{
friend istream& operator >> ( istream& is,DateTime& dt );
friend ostream& operator << ( ostream& os,DateTime& dt );
public:
DateTime();
DateTime(unsigned year,unsigned month,unsigned day,
unsigned hour,unsigned minute,unsigned second);
DateTime( const Date& date, const Time& time );
DateTime( char *dt );
virtual ~DateTime();
public:
const Date& getDate() { return date; }
const Time& getTime() { return time; }
bool operator == ( const DateTime& dt ); // check the first DateTime equal to the other.
bool operator > ( const DateTime& dt ); // check the first DateTime later than the follow
bool operator < ( const DateTime& dt ); // check the first DateTime earlier than the follow
private:
Time time;
Date date;
};
istream& operator >> ( istream& is,DateTime& dt );
ostream& operator << ( ostream& os,DateTime& dt );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -