From: Paul Beckingham <paul@beckingham.net>
Date: Sun, 28 Feb 2010 12:10:06 -0500
Subject: [PATCH] Enhancement - time support in the Date object.
- Added ability to parse and display time, using:
h - single digit hour
H - double digit hour
N - double digit minutes
S - double digit seconds
- Added a request for mktime() to automatically determine whether
summer time should be considered.
- Added Date::Date (m, d, y, hr, mi, se) constructor.
- Added Date::sameHour comparison method.
- Added unit tests.
This commit is contained in:
@@ -38,6 +38,7 @@ public:
|
||||
Date ();
|
||||
Date (time_t);
|
||||
Date (const int, const int, const int);
|
||||
Date (const int, const int, const int, const int, const int, const int);
|
||||
Date (const std::string&, const std::string& format = "m/d/Y");
|
||||
Date (const Date&);
|
||||
virtual ~Date ();
|
||||
@@ -49,6 +50,7 @@ public:
|
||||
const std::string toString (const std::string& format = "m/d/Y") const;
|
||||
const std::string toStringWithTime (const std::string& format = "m/d/Y") const;
|
||||
static bool valid (const std::string&, const std::string& format = "m/d/Y");
|
||||
static bool valid (const int, const int, const int, const int, const int, const int);
|
||||
static bool valid (const int, const int, const int);
|
||||
|
||||
static bool leapYear (int);
|
||||
@@ -75,6 +77,7 @@ public:
|
||||
bool operator> (const Date&);
|
||||
bool operator<= (const Date&);
|
||||
bool operator>= (const Date&);
|
||||
bool sameHour (const Date&);
|
||||
bool sameDay (const Date&);
|
||||
bool sameMonth (const Date&);
|
||||
bool sameYear (const Date&);
|
||||
|
||||
Reference in New Issue
Block a user