From 8e9f83e37751db4658f9617f7bc39d986431bbc4 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Wed, 19 Sep 2018 21:24:23 +0000 Subject: [PATCH] changed: when parsing date skip 'Z' character if exists (iso format) git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1126 e52654a7-88a9-db11-a3e9-0013d4bc506e --- date/date.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/date/date.h b/date/date.h index de08bab..42f20d9 100644 --- a/date/date.h +++ b/date/date.h @@ -800,6 +800,7 @@ bool Date::Parse(const CStringType * str, const CStringType ** str_after) { const CStringType * after; bool result = false; +bool is_iso = false; if( ParseYearMonthDay(str, &after) ) { @@ -811,10 +812,18 @@ bool result = false; // https://en.wikipedia.org/wiki/ISO_8601 // at the moment skip the 'T' character only after += 1; + is_iso = true; } if( ParseHourMinSec(after, &after) ) + { result = true; + + if( is_iso && *after == 'Z' ) + { + after += 1; + } + } } SetAfter(after, str_after);