[gnote] Make sharp::DateTime auto-convertible to Glib::DateTime



commit 4e676760c9ac8148692999300b816d5139f9fe5c
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Mon Jan 20 22:08:59 2020 +0200

    Make sharp::DateTime auto-convertible to Glib::DateTime

 src/sharp/datetime.hpp | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/sharp/datetime.hpp b/src/sharp/datetime.hpp
index 2cd28652..63e657f8 100644
--- a/src/sharp/datetime.hpp
+++ b/src/sharp/datetime.hpp
@@ -91,6 +91,11 @@ public:
   Glib::TimeSpan operator-(const DateTime & dt) const;
   DateTime operator-(const Glib::TimeSpan & ts) const;
 
+  operator Glib::DateTime() const
+  {
+    return Glib::DateTime::create_now_local(m_date);
+  }
+
   glong sec() const
     {
       return m_date.tv_sec;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]