summaryrefslogtreecommitdiff
path: root/include/tools/datetime.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-01-11 13:35:38 +0200
committerEike Rathke <erack@redhat.com>2015-01-13 15:24:04 +0000
commitc32a5a3b8e2e3a49ac9f1fd3f2872b00612676b7 (patch)
treecb2de3eab8dbbcff359d367177d91b67725e1b69 /include/tools/datetime.hxx
parent86db1702d72a103ffeafc69dcaa63318539c147a (diff)
simplify Date/Time/DateTime conversion code
add constructors to Date/DateTime/Time, that take the css::util counterparts, to simplify code converting between these type Change-Id: I4b03da02c63f65b6ec18cb4d6ecc3859bdef1ff7 Reviewed-on: https://gerrit.libreoffice.org/13855 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'include/tools/datetime.hxx')
-rw-r--r--include/tools/datetime.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/tools/datetime.hxx b/include/tools/datetime.hxx
index 256bb7258622..295c587d3b91 100644
--- a/include/tools/datetime.hxx
+++ b/include/tools/datetime.hxx
@@ -22,6 +22,7 @@
#include <tools/toolsdllapi.h>
#include <tools/date.hxx>
#include <tools/time.hxx>
+#include <com/sun/star/util/DateTime.hpp>
class TOOLS_DLLPUBLIC SAL_WARN_UNUSED DateTime : public Date, public tools::Time
{
@@ -45,6 +46,12 @@ public:
DateTime( const tools::Time& rTime ) : Date(0), Time( rTime ) {}
DateTime( const Date& rDate, const tools::Time& rTime ) :
Date( rDate ), Time( rTime ) {}
+ DateTime( const css::util::DateTime& rDateTime );
+
+ css::util::DateTime
+ GetUNODateTime() const
+ { return css::util::DateTime(GetNanoSec(), GetSec(), GetMin(), GetHour(),
+ GetDay(), GetMonth(), GetYear(), false); }
bool IsBetween( const DateTime& rFrom,
const DateTime& rTo ) const;