hour: Add and subtract a number of seconds
[ACL.git] / src / date.h
index 2a7f3e1..7fa59c8 100644 (file)
@@ -268,6 +268,13 @@ public:
       seconds = sec;
    }
 
+   hour(long sec)
+   {
+      hours = sec / 3600;
+      minutes = sec / 60 % 60;
+      seconds = sec % 60;
+   }
+
    hour(String s);
 
    bool proper();   // Check wether this is a proper clock time
@@ -320,6 +327,7 @@ public:
    }
 
    friend hour operator+(hour, hour);
+   friend hour operator+(hour, long);
    hour operator += (hour h);
 
    hour operator ++ ()        // prefix
@@ -333,6 +341,7 @@ public:
    }
 
    friend hour operator-(hour, hour);
+   friend hour operator-(hour, long);
    hour operator -= (hour h);
 
    hour operator -- ()        // prefix