on 01-19-2012 8:43 AM
Hi All
In Bapi i have one parameter i.e.,Login,it is initialized with 00:00:00.I have binded that Login to my table in webdynpro app,it is appearing like 12:00:00AM.So,how can i change that format into 24hrs format.
exactly i want login time is like 00:00:00 while running the webdynpro application
Please help me regarding this.
try converting your data type to gregorian
Timestamp timestamp = new Timestamp(23423434);
Calendar calendar = GregorianCalendar.getInstance();
calendar.setTimeInMillis(timestamp.getTime());
Regards
Senon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi thanks for your reply,i used following code
String logintime;
Format formatter;
Time login = wdContext.currentZbapi_Emp_Timesheet2_InputElement().getLogin();
formatter = new SimpleDateFormat("HH:mm:ss");
logintime = formatter.format(login);
manager.reportSuccess(" time is...................... "+ logintime);
i am getting exception like java.lang.IllegalArgumentException: Cannot format given Object as a Date while printing the logintime.How can i get my context value into login?
The following code is working for me
String logintime;
Format formatter;
Time login = new Time(11, 00, 00);
formatter = new SimpleDateFormat("HH:mm:ss");
logintime = formatter.format(login);
wdComponentAPI.getMessageManager().reportSuccess(
" time is...................... " + logintime);
the imports are as follows
import java.sql.Time;
import java.sql.Timestamp;
import java.text.Format;
import java.text.SimpleDateFormat;
if you still find problems, please give the exception stack
it is also working for me.But i am not able to get my context attribute into that date
String logintime;
Format formatter;
Time login = wdContext.currentItabElement().getLogin();//i am getting problem with this line
formatter = new SimpleDateFormat("HH:mm:ss");
logintime = formatter.format(login);
manager.reportSuccess(" time ********************...................... "+logintime);
After running this code,getting exception like null pointer exception
Dear Vagdevimallaaa
You need to play with SimpleDateFormat with possible input.
Refer to http://www.java-samples.com/showtutorial.php?tutorialid=406 and http://www.roseindia.net/java/javadate/date-format.shtml
Best Regards
Arun Jaiswal
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.