Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.

Labels (3)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

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

4 Replies
vapukov
Master II
Master II

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

 

 

Alexis_Sandvik
Contributor
Contributor

Hello , 

 

I just start to working with Talend Studio, its great .

I try to insert the Date in my output file in new column  with this var ( talendDate ) 

0683p000009M9eW.jpg

but i have an error message .

could you help me ?

Kr

 

Alex


@vapukov wrote:

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

 

 


 

Anonymous
Not applicable
Author

@Alexis_Sandvik , you don't use the function correctly, go to Repository-->Routines-->System and open the TalendDate routine, you will read the source code of this function.

addDate(Date date, int nb, String dateType)

 

If you can't still get it works, please describe your requirement with a bit details.

 

Regards

Shong

Alexis_Sandvik
Contributor
Contributor

Thanks for your feedback

Its working fine with ==> TalendGetDate for add the current date in new column