hi every one, I want to force the print screen of time like => hh:mm it comes from database (my sql) like hh:mm:ss. I tryed the following but i didn't got want i want.
try {
s= HibernateUtil.currentSession();
tx=s.beginTransaction();
Query query = s.createQuery("select from Dailytimesheet dailytimesheet where dailytimesheet.IdDailyTimeSheet=6083 " );
for(Iterator it=query.iterate();it.hasNext();)
{
if(it.hasNext())
{
Dailytimesheet object=(Dailytimesheet)it.next();
String dt=object.getTimeFrom().toString();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
long ms=0;
try {
ms = sdf.parse(dt).getTime();
}
catch (ParseException e) {e.printStackTrace();}
Time ts = new Time(ms);
out.println("<h2>"+ts+"</h2>");
thanks for your help.