I'm trying to parse time only but the app code includes the date and the year.
here is my code:
simpleDateFormat2 = new SimpleDateFormat("HH:mm");
int h = Integer.parseInt(traffic.alarmClocks.get(0).get(ApplicationConstants.HOUR));
int m = Integer.parseInt(traffic.alarmClocks.get(0).get(ApplicationConstants.MINUTE));
String datex2 = h + ":" + m;
Date storedalarm = simpleDateFormat2.parse(datex2);
output of the datex2
is : 4:56
Output of StoredAlarm is this: https://i.stack.imgur.com/EQT06.jpg
The output of the datex2
is correct, but I need to make it into date because I am going to use it to compare times.