I need to format current date in Map function. By default it uses yyyyMMDD HHmmss.SSS format but i want to populate the format as dd-MM-yy HHmmss or dd-MMM-yy HHmmss.
Is there a way possible ?
Hi Vikas, in the map shape you can use the Date function, Date Format. Give it the input mask of yyyyMMDD HHmmss.SSS and output of dd-MM-yy HHmmss or dd-MMM-yy HHmmss. Just make sure your input data is going to match that input mask.
Thanks for your reply. I can certainly use dateformat function but how do I pass my current date which is again retrieved through getCurrentDate function to it ?
If you are using current date, you can make a user defined map function. Step 1 will be get current date, step 2 will be Date format and you would feed result from step 1 into step 2.
If your current date is part of the data being passed through into the map, then you can just link that left hand side into the input mask.
Infact I had tried that but while creating user-defined function, step1 is Input Name and I don't think I can pass the CurrentDate value there directly.
Could I see a picture of your current setup? Are you saying you are passing a current date INTO a map, and then through a function which you are trying to format the date? If you're saying that this is the case, make sure that the date format of the element in question is a Data Type of Date/Time with your source data's Date Format listed. From there, you would pass that element into a Date Format function, Input Mask is the same format you are using for your source element, and then Output Mask is dd-MM-yy HHmmss.
If you are instead trying to get Current Date -> Date Format, Please see the picture below. You will do a Get Current Date function and pass the Result into Date String, giving it an Input Mask of yyyyMMDD HHmmss.SSS and an Output Mask of dd-MM-yy HHmmss.
Thanks Josh for replying. I could figure this out yesterday, but again thanks for posting the screenshot.
That's great to hear Vikas! Would you be able to mark this question as answered then?
Retrieving data ...