Follow the simple a example
java.sql.Time t = new Time(1000);
System.out.println("Time t =" + t);
This gives the following output:
Time t = 01:00:01
While I would expect:
Time t = 00:00:01
Could someone tell me how to get rid of the hours portion?
The
Timeobject is normalized, i.e. the timezone of your JVM is taken into account.Btw, instead of
toString()you might want to useDateFormat#format(Date)and set the time zone on the DateFormat instance.