hey guys im using android time to get my data of shealth I m getting first date of week and month's correctly but im not getting time of start of day im getting output like this
start: Thu, 1 Feb 2019 18:30:00 UTC 6:30 pm EndSun, 31 Mar 2019 12:47:15 UTC 12:47 pm
I want to get that time in
enter code here
start: Thu, 1 Feb 2019 00:00:00 UTC 00:00 pm End Sun, 31 Mar 2019 23:59:59 UTC 11:59 pm
im using that function to get time of week and month
public static long getStartTimeOfWeek() {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.DAY_OF_WEEK, 1);
return cal.getTimeInMillis()+ ONE_DAY;
}
for month :
public static long getMonthDateFirstdate(){
Calendar cal = Calendar.getInstance();
cal.clear(Calendar.MINUTE);
cal.clear(Calendar.SECOND);
cal.clear(Calendar.MILLISECOND);
cal.set(Calendar.DATE,cal.getActualMinimum(Calendar.DAY_OF_MONTH));
return cal.getTimeInMillis();
}