tMap dates operations

Highlighted
Six Stars

tMap dates operations

Hi,

 

I'm working with two dates (format: yyyy-MM-dd HH:mm:ss) like this way: Date_1: 2019-01-01 08:00:00, Date_2: 2019-01-01 12:00:00

What i'd need is the difference between Date_2 and Date_1 and format the result into "HH:mm:ss"

 

Date_2 - Date_1 = 04:00:00

 

I guess you can do this operation using tMap.

 

Thank you,

Enrique


Accepted Solutions
Seven Stars

Re: tMap dates operations

hello @EnriqueLDE ,

by using this query in sql, you will get your output:-

SELECT TIMEDIFF("2019-01-01 08:00:00", "2019-01-01 12:00:00") 

 

Output:- '-04:00:00'

 

Warm Regards,
Manish 

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved


All Replies
Seven Stars

Re: tMap dates operations

hello @EnriqueLDE ,

by using this query in sql, you will get your output:-

SELECT TIMEDIFF("2019-01-01 08:00:00", "2019-01-01 12:00:00") 

 

Output:- '-04:00:00'

 

Warm Regards,
Manish 

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

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 2

Part 2 of a series on Context Variables

Blog

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