on 06-05-2008 9:04 AM
Hi all!
I know that it is too simple for java developers. i want current date (sy-datum) in java. i dont want to re-import my model in which i could write a simple line of code in abap.
java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());
for formatting
SimpleDateFormat d = new SimpleDateFormat(""yyyy.MM.dd");
nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try below code:
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
java.util.Date date = new java.util.Date();
wdContext.currentContextElement().setCtx_Va_String(dateFormat.format(date));
Hope this will help you
Thanks
Sandy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
check this Code .
DateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd");
java.util.Date date = new java.util.Date ();
String dateStr = dateFormat.format (date);
try{
Date date2 = dateFormat.parse (dateStr);
}catch(ParseException pe){
pe.printStackTrace();
Regards ,
Venkat
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 the following code:
//You can get current date using the Java code
Date currDate = new Date(System.currentTimeMillis());
Thanks n Regards,
Jhansi Miryala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.