on 12-05-2011 6:57 AM
Convert date format yyyy-mm-dd to yyyymmdd ?
Could you please tell me how to convert?
thanks
roopa.
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.