on 02-14-2008 11:16 PM
Hello Experts,
In my application one of the context element
wdContext.currentContextElement().getEmployee_employmentDate()
returns the value as 1978-06-15.
Can any one suggest me how to convert this date into 06-15-1978 in webdynpro java.
Thanks and help is really appreciate.
Hi
Use as follows
Date date = new Date(Calendar.getInstance().getTimeInMillis());
Format formatter = new SimpleDateFormat("MM-dd-yyyy");
String s = formatter.format(date);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can use SimpleDateFormat class
DateFormat.java
// jdk1.1.3
//
import java.util.*;
import java.text.*;
SimpleDateFormat formatter
= new SimpleDateFormat ("mm-dd-yyyy");
Date day = wdContext.currentContextElement().getEmployee_employmentDate()
;
System.out.println("for:" + formatter.format( day ));
xxxxxxxxxxxxxxxxxxxx
Edited by: Armin Reichert on Feb 18, 2008 7:13 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bala,
It tried this
import java.util.*;
import java.text.*;
SimpleDateFormat formatter
= new SimpleDateFormat ("mm-dd-yyyy");
Date day = wdContext.currentContextElement().getEmployee_employmentDate()
;
System.out.println("for:" + formatter.format( day ));
...the format is changed 1978-15-06....but now the but is overwritten by 00. it outputs 00-15-1978.
Do I need to include any other step in between??
Thanks,
James
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.