on 02-28-2008 9:54 AM
We are trying to display the join date of employees in a table. It gives mm/dd/yyyy format.
We want the date in dd/mm/yyyy format .Can anyone help me with the code for this?
Hi
Use this code for getting your desired date format
Date dateToBeChanged=<your retrived date from BAPI>;
Format formatter = new SimpleDateFormat("dd/MM/yyyy");
String tempDate = formatter.format(dateToBeChanged);
Now in tempDate you will get your desired date's format
Regards
Chandran S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use followin code
TimeZone tz = TimeZone.getTimeZone("GMT+05:30");//set time zone according to your place
SimpleDateFormat formatter =(SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.LONG,
DateFormat.LONG, Locale.US);
formatter.setTimeZone(tz);
formatter.applyPattern("MM/dd/yyyy");
String datestr =formatter.format(Rdate);
This will give the date as string in required format .
Regards
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Make use of the following code
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("Your Date attribute");
attributeInfo.getDataAttribute().getScalarType().format("dd/MM/yyyy");
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Change the default language to "Hindi" in the Web browser that you use and close the browser and again try to run the same.
This will work.
If its possible just help me how to change the format of a date picker in WD. Right now its mm/dd/yyyy and i want it in dd/mm/yyyy.
Regards
- Vinod
Reward if found helpful.
Edited by: Vinod V on Feb 29, 2008 11:34 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
-Create a simple data type
-In Representation - Format - specify dd/mm/yyyy
-Assign this simple data type to required column in ur table.
-
Shyam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anzar,
If the value is coming from the backend and you just want to display as dd/MM/yyyy then in wdDoInit() of your View do the following --> get the current date value, format it as per your need and then set it back.
// Check the size of the nodeelement which contains your atribute.
int size = wdContext.node<NodeName>().size();
// Loop over and set the value
for (int i = 0; i < size; i++)
{
String strJoinDtModel = wdContext.current<NodeName>Element().get<AttributeName>.toString();
String strNewDtJoin = formatDate("strJoinDtModel");
wdContext.current<NodeName>Element().set<AttributeName>(strNewDtJoin);
}
So if u have following hierarchy
Employee (ModelNode)
|---- JoinDate (Model Attrribute)
then NodeName = Employee and AtrributeName = JoinDate in above code snippet.
You will need to create a formatDate() method as follows:-
public String formatDate(String strDate)
{
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); // Note the uppercase for month.
String newDate = sdf.format(strDate);
return newDate;
}
Hi ,
u can do it in 2 ways
1) for stand alone applications In Control Panel ->Regional and Language Options change the languaue settings to English UK.
2) for portal applications In User Administration while creating a user give language as English UK , for exsisting users modify language to English UK.
Thanks,
Sunitha Hari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anzar,
Check this
http://javatechniques.com/blog/dateformat-and-simpledateformat-examples/
regards
Sumit
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 following:
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy ");
String dateReturn = dateFormat.format(<Your Date>) ;
Hope this helps.
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai the following are some func modules availabel for date conversion.you can make use of it.
CONVERSION_EXIT_LDATE_OUTPUT Converts date format
CONVERT_DATE_TO_EXTERNAL Formats date from internal to display format
CONVERT_DATE_TO_INTERNAL Formats date from display to internal format
DATE_CONV_EXT_TO_INT Conversion of dates to SAPs internal format
DATE_CONVERT_TO_FACTORYDATE Converts calendar date into factory day
DATE_CONVERT_TO_WORKINGDAY Converts a calendar
Thanks n Regards
Sharanya.R
Hi,
Use this code:
java.util.Calendar cal = java.util.Calendar.getInstance();
cal.setTime(quotationValidFrom);
//cal.set(quotationValidFrom.getYear(),quotationValidFrom.getMonth(),quotationValidFrom.getDate());
cal.add(java.util.Calendar.DATE, NoOfDays+1);
//String sAddDate = cal.getTime().toGMTString();
String DATE_FORMAT = "dd-MM-yyyy";
java.text.SimpleDateFormat sdf =
new java.text.SimpleDateFormat(DATE_FORMAT);
//requestedDeliveryDate.setTime(cal.getTime().to);
String ReqDate = sdf.format(cal.getTime());
Regards,
Kiran Yadav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.