Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
DaveTaylor
Contributor III
Contributor III

tHMap ExtractFromDateTime function - the specified date/time does not match the specified pattern

6.4.1

 

I have a tHMap mapper map; that is throwing this error at runtime:

20: Error - The specified date/time does not match the specified pattern. (336)
Map: /DIH_PENDINGBUSINESS/Maps/case_mapping.xml - Map Element: out$/Root/applicationReceivedDate
Pattern - EEE MMM dd HH:mm:ss z yyyy
Value: Fri Oct 20 05:00:00 UTC 2017

 

The value above is being passed as a jSon String property.
I am not seeing anything wrong with the above pattern; and why it is not matching.

When I run this in designtime; using the Mapper Test feature on the field; with the same input value; the design-time Test result for the field doesn't error; and returns back:  
2017-10-20 as expected.

It is only failing at runtime with the above error.

Any ideas on why it is failing at runtime but works in testmode at design time?

 

Here are relevant screencaps from the mapper:

 


Input field is: hoReceiptDate; output field is applicationReceivedDate:

0683p000009M063.jpg

 

 

 



The input Json sample test value:

0683p000009M08X.jpg

 

 

 

the output mapping Util logic:
0683p000009Lzy5.jpg

 

 

the output mapping Value logic: 
0683p000009M06I.jpg

 

 

the designtime TestRun results:
0683p000009M077.jpg

Labels (4)
1 Solution

Accepted Solutions
DaveTaylor
Contributor III
Contributor III
Author

I think  ultimately the mapper's ParseDateTime function doesn't appear to provide a parameter for you to provide the locale.
Because of that; the ExtractFromDateTime is not working on the ParseDateTime above.

I changed my mapper expression to drop the use of the ParseDateTime function; and instead call the TalendDate.parseDateLocale function as follows, and it works fine at both TestRun (designtime) and at runtime:

0683p000009LztA.jpg

View solution in original post

4 Replies
fdenis
Master
Master

you can check the server configuration timezone and country.
fri Oct are in English
if server is in french it is waiting for Ven Oct
DaveTaylor
Contributor III
Contributor III
Author

Thanks server is usa not french.

 

Like I said above;  the mapper 'test run output' works fine as expected at runtime for the same value that it is raising the error on at runtime (The specified date/time does not match the specified pattern.).

 

Anyone else seen this issue on Mapper converting a json string date in the format of 'Fri Oct 20 05:00:00 UTC 2017' into a json string date in the format of '2017-10-20'?

 

DaveTaylor
Contributor III
Contributor III
Author

I think  ultimately the mapper's ParseDateTime function doesn't appear to provide a parameter for you to provide the locale.
Because of that; the ExtractFromDateTime is not working on the ParseDateTime above.

I changed my mapper expression to drop the use of the ParseDateTime function; and instead call the TalendDate.parseDateLocale function as follows, and it works fine at both TestRun (designtime) and at runtime:

0683p000009LztA.jpg

Anonymous
Not applicable

I am currently concatenating Start Date and Start Time from input to StartTS in output in Talend Data Mapper but both the field I am taking as String. 

How should I change the datatype in output JSON to Date ??

Inputs needed please..