00001 #ifndef DATETIME_H
00002 #define DATETIME_H
00003
00004 #include <iostream>
00005 #include <string>
00006 #include <sstream>
00007
00008 using namespace std;
00009
00018 class DateTime
00019 {
00020
00021 friend ostream &operator<<( ostream &out, const DateTime &dt );
00022 friend istream &operator>>( istream &in, DateTime &dt );
00023
00024 public:
00025 DateTime();
00026 DateTime( int mm, int dd, int yy, int h, int m, string period );
00027 void setDate( int mm, int dd, int yy );
00028 void setTime( int h, int m, string period );
00029 void read( istream &in );
00030 void write( ostream &out ) const;
00031 void writeln( ostream &out ) const;
00032 void print( ostream &out = cout ) const;
00033 void println( ostream &out = cout ) const;
00034 string toString() const;
00035 bool operator==( const DateTime &dt ) const;
00036 bool operator!=( const DateTime &dt ) const;
00037 bool operator<( const DateTime &dt ) const;
00038 bool operator>( const DateTime &dt ) const;
00039
00040 private:
00042 int mm;
00044 int dd;
00046 int yy;
00048 int h;
00050 int m;
00052 string period;
00053
00054 };
00055
00056 #endif