cancel
Showing results for 
Search instead for 
Did you mean: 

User Defined Function

Former Member
0 Kudos

Hi,

My UDF should have the todays date with the format of yyyyMMdd without any ( / ) or ( - ) inbetween.

please provide me a code to get this date format in UDF.

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Thank you

former_member183906
Active Contributor
0 Kudos

You do not need an UDF.

You can use DateTransformation function from Date functions group.there specify source and target date format.

You can write it yourself.

Dont select value from drop down.

Write it as yyyyMMdd

Save and activate mapping.

Test it. It will work.

Former Member
0 Kudos

Hi ,

you can do this through graphical mapping even.

Use the date functions.

current date->Transform date(Date Trans)->target

Right click on Transform date and choose properties and set the target format.

Edited by: malini balasubramaniam on Sep 17, 2008 12:49 PM

Former Member
0 Kudos

Hi ,

No need UDF there is standard function for date , give your source and target date format. that would work.

No UDF needed !

rgds

srini

SudhirT
Active Contributor
0 Kudos

Try this code

Write this thing in import section :

java.text.SimpleDateFormat;java.util.Calendar

Write your code here:

String DATE_FORMAT = "yyyyMMdd";

SimpleDateFormat sdf =

new SimpleDateFormat(DATE_FORMAT);

Calendar c1 = Calendar.getInstance(); // today

result.addValue("" + sdf.format(c1.getTime()));

Thanks!

Former Member
0 Kudos

Hi sujatha

You need not to write UDF. The current date with yyyyMMdd formate. You need to use 'currentDate' functin in which u can remove date seperators.

Regards

Raj

Edited by: raj sharma on Sep 17, 2008 12:43 PM

Former Member
0 Kudos

Hi,

you could use the standard function currentDate. If you double click on it you can specify the date as yyyyMMdd.

No need for an UDF.

Regards

Patrick