When you set the clock to Date, the object java.util.Dateis independent of the concept TimeZone. On his javadoc here ,
Although the Date class is designed to reflect coordinated universal (UTC), it may not do it exactly, depending on the host of the Java virtual machine environment.
, 15, . UTC ( ) , (14 15).
, 1 , UTC :
String time = "15:54";
Date date = new Date();
java.util.TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
date.setHours(Integer.parseInt(time.substring(0, 2)));
long hours = (date.getTime() / (60 * 60 * 1000)) % 24;
System.out.print(hours);
System.out.print("\n" + date.getHours());
: Calendar class ( jodatime), TimeZone.