From dd24f18545d1e041b2dc427ce4d6c28fbd39d76d Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Tue, 30 Apr 2013 00:06:54 +0200 Subject: [PATCH] now ooxml files are accepted by Excel again Yes, a simple test would have answered the question in the comment and made clear that nanoseconds are not accepted by MSO. Let's go with normal seconds as MSO does. It seems it also accepts 1/100s but who really needs that for a file timestamp. Change-Id: Iaec6f9c08dc94d5086b83cb4bf520d0053b71b28 --- oox/source/core/xmlfilterbase.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 4cd7665be98c..fe2055e6eda2 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -482,12 +482,9 @@ writeElement( FSHelperPtr pDoc, sal_Int32 nXmlElement, const util::DateTime& rTi FSEND ); char pStr[200]; - // FIXME: my guess is that precision greater than millisecond in undesirable - // (forbidden by the standard???) - snprintf( pStr, sizeof( pStr ), "%d-%02d-%02dT%02d:%02d:%02d.%09" SAL_PRIuUINT32 "Z", + snprintf( pStr, sizeof( pStr ), "%d-%02d-%02dT%02d:%02d:%02dZ", rTime.Year, rTime.Month, rTime.Day, - rTime.Hours, rTime.Minutes, rTime.Seconds, - rTime.NanoSeconds); + rTime.Hours, rTime.Minutes, rTime.Seconds ); pDoc->write( pStr );