summaryrefslogtreecommitdiff
path: root/src/local_time.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-12-23 01:05:49 +0100
committerCarl Hetherington <cth@carlh.net>2019-12-23 01:05:49 +0100
commit64e72c622be986c7272e938c2d3235c61abef402 (patch)
tree6cece3eee55fd26a79b2aa3c7e618f55258bcefc /src/local_time.h
parent2b5af718d2a1f5da548303c8531afe86fa82d2d8 (diff)
Add struct tm constructor for LocalTime, use it to tidy up
day_{greater,less}_than_or_equal and add add_months() method.
Diffstat (limited to 'src/local_time.h')
-rw-r--r--src/local_time.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/local_time.h b/src/local_time.h
index f5723783..0b13985c 100644
--- a/src/local_time.h
+++ b/src/local_time.h
@@ -58,6 +58,7 @@ class LocalTime
{
public:
LocalTime ();
+ explicit LocalTime (struct tm tm);
explicit LocalTime (boost::posix_time::ptime);
LocalTime (boost::posix_time::ptime, int tz_hour, int tz_minute);
explicit LocalTime (std::string);
@@ -82,6 +83,8 @@ public:
_year = y;
}
+ void add_months (int a);
+
bool operator== (LocalTime const & other) const;
bool operator!= (LocalTime const & other) const;
bool operator< (LocalTime const & other) const;
@@ -89,6 +92,7 @@ public:
private:
friend class ::local_time_test;
+ void set (struct tm const * tm);
void set_local_time_zone ();
/* Local time */