Skip to Content
0

UDF for 07-OCT-17 to 20171007

Oct 26, 2017 at 12:40 PM

47

avatar image
Former Member

Hi,

Please help with the UDF.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Raghuraman S Oct 26, 2017 at 02:53 PM
0

My bad,Please change the output format to yyyyMMdd


11.png (32.7 kB)
12.png (3.4 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi,

Raghu thanks it worked.

0

Glad to hear.:)

0
Raghuraman S Oct 26, 2017 at 01:12 PM
1

You can achieve this using standard date transformation like below

Paste the formats for input as dd-MMM-yy and output as

yyyymmdd


1.png (20.3 kB)
capture111.png (40.5 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Raghu,

I am having only these date formats.i have pasted input and output as per my requirement but getting error in mapping and your month is representing as 00.

format.png

format.png (9.6 kB)
0

Please change as per my below comment Sai ,Output format should be yyyyMMdd

0
Evgeniy Kolmakov Oct 26, 2017 at 12:54 PM
0

Hi Sai!

Here is an example of java method for date format conversion:

public static String convertDate(String srcDateString, String srcDateFormat, String dstDateFormat) {
String dstDateString = "";

if (srcDateFormat == null || srcDateFormat.trim().isEmpty() || dstDateFormat == null || dstDateFormat.trim().isEmpty())
return dstDateString;

SimpleDateFormat srcFormatter = new SimpleDateFormat(srcDateFormat);
Date srcDate = null;

if (srcDateString == null || srcDateString.trim().isEmpty())
srcDate = new Date();
else
try {
srcDate = srcFormatter.parse(srcDateString);
} catch (ParseException e) {
return dstDateString;
}

SimpleDateFormat dstFormatter = new SimpleDateFormat(dstDateFormat);
dstDateString = dstFormatter.format(srcDate);

return dstDateString;
}

Regards, Evgeniy.

Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Is there any UDF other than this.

0

It can be achieved using standard function,check my reply.

0

And what's wrong with this code?

Regards, Evgeniy.

1
Former Member

Hi ,

Please help me with Simple UDF.

0