on 10-13-2011 5:26 AM
hi Experts,
i need to change date formate from DD/mm/yy to dd.mm.yy can you tel me how can it be done.
Hi,
Use SimpleDateFormat to achieve this..
Regards,
Vijay.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try the below code...
java.sql.Date sysDate = null;
String strSysDate = null;
sysDate = new java.sql.Date(Calendar.getInstance().getTime().getTime());
Calendar cal = Calendar.getInstance();
cal.setTime(sysDate);
int date = cal.get(Calendar.DATE);
int month = cal.get(Calendar.MONTH)+1;
int year = cal.get(Calendar.YEAR);
strSysDate = date+"."+month+"."+year;
Tweeking this can help you get your desired result..
Regards,
Vijay.
Hi Shankha,
I had also the same problem.. and the solution provided by u was done by me.... bt my problem was not solved... please help....
Thanks ,
Sweta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Prajakta,
You can do it following below simple steps. First create a simple data type of type date in Local Dictionary of your webdynpro application. Then go to the Representation tab of the data type and change the Format to desired format(like dd.MM.yyyy). Then create a context attribute and set the type of this attribute to the simple data type you created before. Now you can assign this context attribute to your UI element(Input field) , run and test the application, value display format will be dd.MM.yyyy
Thanks
Shankha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I hope this following example will help you
public class DateFormat
{
public static void main(String[] args)
{
try {
// e.g dd/MM/yy = 13/10/11
SimpleDateFormat fromDateFormat = new SimpleDateFormat("dd/MM/yy");
SimpleDateFormat toDateFormat = new SimpleDateFormat("dd.MM.yy");
Date date = fromDateFormat.parse("13/10/11");
String str = toDateFormat.format(date);
System.out.println(str);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Thanks
Gautam Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.