i am using the DataType Time in my database it stores the data in the form as 01:23:14.0000000.
i am using dateTime controls of sWt as
DateTime dateTime = new DateTime(cmpGrid, SWT.BORDER | SWT.TIME);
i can save the Value of DateTime easily as
String hours =String.valueOf(timeTo.getHours());
String minutes =String.valueOf(timeTo.getMinutes());
String seconds =String.valueOf(timeTo.getSeconds());
objhallModel.setClose_time(hours + ":"+minutes + ":" + seconds);
For Editting purpose i need to set The time value in my design view For that i want to use
dateTime.setTime(hours, minutes, seconds);
it takes all hours, minutes, second in integer… can please anybody tell me how to set The time in DateTime of Database time value. thanks in advance
I think you are using org.eclipse.swt.widgets.DateTime in your user interface and java.sql.Time to store in your database.
I note that the javadoc of Time says:
Therefore, I think you should set it as follows:
The reverse operation (maybe this is what you want, I wasn’t sure from your question) would be: