datetime.h

来自「标准C++编写的小小CRM软件,无任何平台依赖.采用标准XML作为数据库.只需重」· C头文件 代码 · 共 36 行

H
36
字号
// 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 + =
减小字号Ctrl + -
显示快捷键?