on 07-31-2006 1:57 PM
Hi all
I am using date context variable bound with InputField to get date from user.But it is showing the date in mm/dd/yyyy format when user selects a date.I want to display it in dd/mm//yyyy format when user selects.
How can I do this
Thanks in advance
Fahad Hamsa
Hi,
use this
SimpleDateFormat fmtDatePlain = new SimpleDateFormat("dd/mm/yyyy");
String formattedDate = fmtDatePlain.format(date);
You get the formatted date..
Regards
Saravanan K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fahad,
You can also create a Simple Type in your local dictionary, use "date" for the type and enter your required format in the representation tab.
Assign this to your context attribute.
Then you will still get the DateNavigator and have your format.
Trying this out in the past I've seen strange formatting effects, though: after picking a date some default format seems sometimes to be used.
Regards
Markus
Hi
do you want to set the dateformat in the portal.
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
try This
SimpleDateFormat simple=new SimpleDateFormat("DD/MM/yyyy
");
String newdat=simple.format(olddate);
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.