Adding 1 minute in the parm file

Highlighted
Six Stars

Adding 1 minute in the parm file

Hi All,

 

I need to add 1 min to the parm file's end date and assign this time to FILE_NAME_TIME_STAMP context fieldname(which is string) and I am using TalendDate.addDate function for date and this is working fine for all times except for 12:29 and 12:59, Ideally it should make the date to 12:30 and 13:00, instead of this, date is modifying to 00:30 and 01:00, can somebody suggest on this and how to get the desired output.

 

TalendDate.formatDate("yyyyMMdd_HHmm",TalendDate.addDate(row1.end_dttm,1,"mm"))

Twelve Stars

Re: Adding 1 minute in the parm file

check format of row1.end_dttm it may be set to 12 hour format
is row1.end_dttm a string?
if yes convert it first using TalendDate.parseDate(“yyyy-MM-dd’T’HH:mm:ss.SSS”, row1.end_dttm)

Francois Denis

Tag as "solved" for others! Kudos to thanks!

Six Stars

Re: Adding 1 minute in the parm file

Spoiler
Spoiler
 

Thanks, it was hhmm there.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog