tHMap date format for JSON

Highlighted
Six Stars

tHMap date format for JSON

Hello everyone,

I am using a tHMap to create a JSON object for a webservice. The webservice requires the following date format:

yyyy-MM-dd'T'HH:mm:ss'Z'

I cannot find this specific date format in the Date Formats of the structure. I neither could find a way to define a custom date format. Thus, I am using "Default" as date format at the moment and defined the desired format in the Talend Data Integration schema, which is used as the input for the tHMap. As a result I get the following date format:

yyyy-MM-dd'T'HH:mm:ss.SSS

 

Hence, my question: How can the date format of the tHMap JSON output be changed or customized?

Regards,

Tobi

Nine Stars

Re: tHMap date format for JSON

in tMap you can try this 

 

DateFormat.PNG

Regards,

Veeru Boppudi
Six Stars

Re: tHMap date format for JSON

Hi vboppudi,

thank you for your input. I know how to do it in a tMap, this would be my workaround: Transforming the dates to a string and passing it to the tHMap as string. But from my point of view this is only a workaround and not an ideal solution, as I always have to do a null-safe explicit transformation instead of passing the values through.

Regards.

What’s New for Talend Spring ’19

Join us live for a sneak peek!

Sign up now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads