diff options
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/misc/datetime.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/unotools/source/misc/datetime.cxx b/unotools/source/misc/datetime.cxx index 55c61988c8c8..979db79e13cd 100644 --- a/unotools/source/misc/datetime.cxx +++ b/unotools/source/misc/datetime.cxx @@ -18,12 +18,14 @@ */ #include <unotools/datetime.hxx> +#include <unotools/syslocale.hxx> #include <tools/date.hxx> #include <tools/time.hxx> #include <tools/datetime.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/math.hxx> #include <osl/diagnose.h> +#include <vcl/svapp.hxx> #include <sstream> namespace @@ -193,6 +195,27 @@ namespace namespace utl { +const LocaleDataWrapper& GetLocaleData() +{ + static SvtSysLocale ourSysLocale; + return ourSysLocale.GetLocaleData(); +} + +DateTime GetDateTime(const css::util::DateTime& _rDT) { return DateTime(_rDT); } + +OUString GetDateTimeString(const css::util::DateTime& _rDT) +{ + // String with date and time information (#i20172#) + DateTime aDT(GetDateTime(_rDT)); + const LocaleDataWrapper& rLoDa = GetLocaleData(); + + return rLoDa.getDate(aDT) + " " + rLoDa.getTime(aDT); +} + +OUString GetDateString(const css::util::DateTime& _rDT) +{ + return GetLocaleData().getDate(GetDateTime(_rDT)); +} void typeConvert(const Date& _rDate, css::util::Date& _rOut) { |