Question

2
Replies
133
Views
MAHESHHR Member since 2011 7 posts
Virtusa Corporation
Posted: 1 month ago
Last activity: 4 weeks 1 day ago

PRDateFormat.parseAsDateTime is not working as expected

As per Engine API definition, 

public static final java.util.Date parseAsDateTime(java.lang.String aLocale,
                             java.lang.String aZone,
                             java.lang.String[] aPatterns,
                             java.lang.String aValue)

convenience method to parse a String as a DateTime, trying a list of patterns in an attempt to guess the correct format.

Parameters:
aLocale - locale to use
aZone - time zone to default
aPatterns - array of patterns, if null or empty, a default list will be used
aValue - String to parse

----------------

I'm setting Patterns as below :

java.lang.String[] aPatterns = { PRDateFormat.DEFAULT_DATETIME_DEFAULT, PRDateFormat.DEFAULT_DATETIME_SHORT,    PRDateFormat.DEFAULT_DATETIME_LONG, PRDateFormat.DEFAULT_DATETIME_FULL, PRDateFormat.DEFAULT_DATETIME_SHORT_YY, PRDateFormat.DEFAULT_DATETIME_SHORT_YYYY  };

 

At Runtime can you explain which Pattern will be used ?

I want to understand how this function picks the Pattern from this array ?

***Edited by Moderator: Pallavi to update platform capability tags***  

 

Pega Platform 7.3.1 Data Integration Java and Activities
Share this page LinkedIn