summaryrefslogtreecommitdiff
path: root/xmloff/source/core/xmluconv.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source/core/xmluconv.cxx')
-rw-r--r--xmloff/source/core/xmluconv.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index 5ea85f108975..6ceb8850b014 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -436,9 +436,16 @@ void SvXMLUnitConverter::convertDateTime( OUStringBuffer& rBuffer,
aDate += 1;
}
}
- rBuffer.append( sal_Int32( aDate.GetYear()));
+ sal_uInt16 nTemp = aDate.GetYear();
+ if (nTemp < 1000)
+ rBuffer.append( sal_Unicode('0'));
+ if (nTemp < 100)
+ rBuffer.append( sal_Unicode('0'));
+ if (nTemp < 10)
+ rBuffer.append( sal_Unicode('0'));
+ rBuffer.append( sal_Int32( nTemp));
rBuffer.append( sal_Unicode('-'));
- sal_uInt16 nTemp = aDate.GetMonth();
+ nTemp = aDate.GetMonth();
if (nTemp < 10)
rBuffer.append( sal_Unicode('0'));
rBuffer.append( sal_Int32( nTemp));