diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-03-07 13:19:22 +0100 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-03-08 17:50:58 +0100 |
commit | 09c3b8ab70b115aaea8fe68557da2cc5edde4181 (patch) | |
tree | 50dca746af318aa8c6bd488c48eaeeab33845cb1 /unotools | |
parent | 066dcba00659d2f81e4ba67edd14c44ed9ec3ea2 (diff) |
unotools: extractDate and extractTime functions
Added a pair of functions to split a UNO DateTime object into the
corresponding Date and Time objects.
Change-Id: I6bf31d83b3843a9482d6bf538a5dd7130c2c7046
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/misc/datetime.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/unotools/source/misc/datetime.cxx b/unotools/source/misc/datetime.cxx index 068209489d6d..96de5106f388 100644 --- a/unotools/source/misc/datetime.cxx +++ b/unotools/source/misc/datetime.cxx @@ -215,6 +215,23 @@ void typeConvert(const starutil::DateTime& _rDateTime, DateTime& _rOut) } +void extractDate(const starutil::DateTime& _rDateTime, starutil::Date& _rOut) +{ + _rOut.Day = _rDateTime.Day; + _rOut.Month = _rDateTime.Month; + _rOut.Year = _rDateTime.Year; +} + + +void extractTime(const starutil::DateTime& _rDateTime, starutil::Time& _rOut) +{ + _rOut.Hours = _rDateTime.Hours; + _rOut.Minutes = _rDateTime.Minutes; + _rOut.Seconds = _rDateTime.Seconds; + _rOut.NanoSeconds = _rDateTime.NanoSeconds; +} + + OUString toISO8601(const starutil::DateTime& rDateTime) { OUStringBuffer rBuffer; |