I want to create a Calendar object, but how can I take a given hour and minutes and adjust the date?
Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR,hora); //valores tomados de un TimePickerDialog
c.set(Calendar.MINUTE,minutos); //valores tomados de un TimePickerDialog
To check that it is ok I write it in the Logcat. What happens is that when I put for example the: 5:30 am when using
c.getTime().toString()
shows me: Fri Mar 30 17:30:00 GMT-04:00 2018
or is inverted from am to pm and vice versa. What can cause this? Also, if it's 4:30 p.m. on Saturday and I'll set it to 4:15 p.m., I'm supposed to get 4:15 p.m. but not Sunday? But it shows me: 16:15 on Saturday. I guess it's because of AM and PM