Hello
I'm coding in java on android and using the calendar class to handle dates.
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH,1);
cal.set(Calendar.HOUR_OF_DAY, 2);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
obj.put("paymentDate",cal.getTime());
As you can see above , I added a day to the day of month , so today is 1st of june , it would be 2nd of june
and also I set the hour to 02 , and others to zero.
I put out a toast for getTime() and it gives me correct results.
But in my database this is being saved.
2020-06-01T20:00:00.000Z (Which means first of June , with hour of 20)
Please help