TMap - Date Format

Five Stars

TMap - Date Format

Hello,

I need to insert a specific format in the Name field of a Salesforce object.

Example: Name: F - Check - 19-06-2019 - 30-06-2019.

 

The first date is the date of today.

The second date is the end of the month date.

 

In my tMap I used:

- TalendDate.getLastDayOfMonth (TalendDate.addDate (TalendDate.getCurrentDate (), 0, "MM")): for the end-of-month date

- TalendDate.getCurrentDate () for today.

 

The result is as presented: F - 20190614 - Wed 31 Jul 04:56:40 CDT 2019 - Tue. Jul 23 04:56:40 CDT 2019

 

Can you help me adapt both dates?

 

Thank you.


Accepted Solutions
Forteen Stars

Re: TMap - Date Format

Hi,

 

you just need convert date to string

TalendDate.formatDate("dd-MM-yyyy", TalendDate.getLastDayOfMonth (TalendDate.getCurrentDate ()))  - end of Month

TalendDate.formatDate("dd-MM-yyyy", TalendDate.getCurrentDate ())  - today

 

 

-----------

View solution in original post


All Replies
Forteen Stars

Re: TMap - Date Format

Hi,

 

you just need convert date to string

TalendDate.formatDate("dd-MM-yyyy", TalendDate.getLastDayOfMonth (TalendDate.getCurrentDate ()))  - end of Month

TalendDate.formatDate("dd-MM-yyyy", TalendDate.getCurrentDate ())  - today

 

 

-----------

View solution in original post

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