cancel
Showing results for 
Search instead for 
Did you mean: 

Convert date

Former Member
0 Kudos

Convert date format yyyy-mm-dd to yyyymmdd ?

Could you please tell me how to convert?

thanks

roopa.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi roopa,

Convert date format yyyy-mm-dd to yyyymmdd ?

As per my knowledge, that is possible with standard function u201CDateTransu201D of the DATE group and set the input and output date formats as per your requirement.

Search in SDN, there are plenty of blogs, and forum threads.

thanks,

Former Member
0 Kudos

Hi bhavanhi,

Yes I know about DateTrans but If I use DateTrans function then getting space between yyyy and mm ,u2026.

How to remove space between yyyy, mm and dd ?

thanks

roopa........

Former Member
0 Kudos

hi roopa,

Okay. That is very simple Delete space between yyyy and mm , dd using by backspace.

Thanks,

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Use the standard function "dateTrans". No need of a UdF or a function to remove '-'. Just do that:

Input = yyyy'-'mm'-'dd with simple quote to encapsulate minus character -.

output = yyyymmdd

Mickael

anupam_ghosh2
Active Contributor
0 Kudos

Hi Roopa,

you can use normal text replaceString function


date ---------------------->                   
Constant(-)--------------->        replaceString---------------------->target
Constant()--------------->

or you can try this UDF


public String TransDate(String a,Container container){
   //write your code here
try
{
	a=a.replaceAll("-","");
				
}
catch(Exception e)
{
       e.printStackTrace();
}
return a;
}

Regards

Anupam