Switch to testing on Ubuntu 16.04 and 22.04.
[libdcp.git] / src / local_time.h
index fdb6fc90646bc39988f4ee75bc46b6cd5fc89775..c76b876cf8864feed8afe2aa5ca00a94eaa6ca5c 100644 (file)
@@ -60,6 +60,9 @@ namespace dcp {
  *  to parse strings of the required format (those that include time zones).
  *
  *  See http://www.w3.org/TR/xmlschema-2/#dateTime
+ *
+ *  Note that operator== for this class will return true for times that have different
+ *  offsets but are the same actual time.
  */
 class LocalTime
 {
@@ -89,8 +92,10 @@ public:
                , _offset(offset)
        {}
 
-       /** @return A string of the form 2013-01-05T18:06:59+04:00 or 2013-01-05T18:06:59.123+04:00 */
-       std::string as_string (bool with_millisecond = false) const;
+       /** @return A string of the form 2013-01-05T18:06:59+04:00, 2013-01-05T18:06:59.123+04:00
+        *  2013-01-05T18:06:59 or 2013-01-05T18:06:59.123
+        */
+       std::string as_string(bool with_millisecond = false, bool with_timezone = true) const;
 
        /** @return The date in the form YYYY-MM-DD */
        std::string date () const;
@@ -154,7 +159,9 @@ public:
        bool operator== (LocalTime const & other) const;
        bool operator!= (LocalTime const & other) const;
        bool operator< (LocalTime const & other) const;
+       bool operator<=(LocalTime const & other) const;
        bool operator>(LocalTime const & other) const;
+       bool operator>=(LocalTime const & other) const;
 
 private:
        friend struct ::local_time_basic_test;