This code works but when it converts the input into milliseconds it adds five hours. Is there a fix for this?
ArrayList<String> timeList = new ArrayList<String>();
Scanner in = new Scanner(System.in);
System.out.println("Please enter time you arrived (HH:mm:ss): ");
timeList.add(in.next());
SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
String arriveTime = timeList.get(0);
try{
Date date1 = format.parse(arriveTime);
long finalTime = date1.getTime();
}catch (Exception e) {
System.out.println("An error occurred");
}