cancel
Showing results for 
Search instead for 
Did you mean: 

Time format

Former Member
0 Kudos

hi there,

i am having problem while inserting the time in to the database table.i m using java.sql.time .and my database is in oracle.if i enter the time using any format other than 10:09:05 AM then i get a <b>error message to insert in : : : format</b>. but if i do so then it throws sql error that sql error** <b>: is unexpected</b>.

please guide with ur valuable ideas.

thankx in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can use the following code to format time..

Time ff = new Time(System.currentTimeMillis());

SimpleDateFormat objdateformat = new SimpleDateFormat("K:mm:ss a");//will give u in the format as u said

wdContext.currentContextElement().setTime("Time = "+ objdateformat.format(ff));

Check if it is helpful

AD

Former Member
0 Kudos

hi AD

thankx for ur reply..actually the server where i used to deploy code is not working so cant try this right now..any way i will....but i have a doubt...i want the time to be entred by the user..not the current syatem time..like user setting some event to occur in future...what changes should i made for that in the code

thanx