I was working on Android APP related to custom CRM. Where I was to save appointment in database using WCF API. I tried couple of solutions. I tried sending date without time zone offset the WCF API saved 1 hour before timing. I tried with correct offset of time zone but still facing issue then I tried with and send date time as string without time zone and it worked.
SimpleDateFormat format1 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Add hrs and min to date time in Android Java;
public static Date addMinutesToDate(Date date, int minutes) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.MINUTE, minutes); return calendar.getTime(); } public static Date addHoursToDate(Date date, int hours) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.HOUR_OF_DAY, hours); return calendar.getTime();