diff options
Diffstat (limited to 'shell/source')
-rw-r--r-- | shell/source/win32/shlxthandler/util/iso8601_converter.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/shell/source/win32/shlxthandler/util/iso8601_converter.cxx b/shell/source/win32/shlxthandler/util/iso8601_converter.cxx index 36ab617441e6..9933a9c41805 100644 --- a/shell/source/win32/shlxthandler/util/iso8601_converter.cxx +++ b/shell/source/win32/shlxthandler/util/iso8601_converter.cxx @@ -36,6 +36,15 @@ std::wstring iso8601_date_to_local_date(const std::wstring& isoDate ) { ::std::wstring ws8601DateTime(isoDate); + // Get rid of the optional milliseconds part if it exists. + // Function accepts date/time as a combined date/time string in extended ISO8601 format, + // which is yyyy-mm-ddThh:mm:ss[.mmm]. Last part is the optional "fraction of second" part, + // that's why we cut off at 19. + if (ws8601DateTime.length() > 19) + { + ws8601DateTime.erase(19, ::std::basic_string<char>::npos); + } + if ( ws8601DateTime.length() == 19 ) { std::string asDateTime = WStringToString( ws8601DateTime ); |