From 61536b231b792e44bcc3c2c160825f4db333f2b0 Mon Sep 17 00:00:00 2001 From: Ravikiran Katneni Date: Fri, 8 Feb 2019 11:16:33 +0530 Subject: [PATCH] Update the pattern to match . in the data string for truncating seconds part. --- .../src/org/eclipse/birt/core/data/DateFormatISO8601.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DateFormatISO8601.java b/core/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DateFormatISO8601.java index a5d128bc1af..47fb2fd8d60 100644 --- a/core/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DateFormatISO8601.java +++ b/core/org.eclipse.birt.core/src/org/eclipse/birt/core/data/DateFormatISO8601.java @@ -33,7 +33,8 @@ public class DateFormatISO8601 { private static Pattern T_PATTERN = Pattern.compile( "T" ); - private static Pattern TIME_PART_PATTERN = Pattern.compile( "\\d\\d:\\d\\d:\\d\\d.\\d+" ); + //Time pattern matches the time part similar to 02:15:01.999620 + private static Pattern TIME_PART_PATTERN = Pattern.compile( "\\d\\d:\\d\\d:\\d\\d\\.\\d+" ); /** * Parse a date/time string. @@ -55,6 +56,7 @@ public static Date parse( String source, TimeZone timeZone ) throws BirtExceptio } if ( dateFormat != null ) { + source = cleanDate( source ); resultDate = dateFormat.parse( source ); } return resultDate;