Android Date Set firstTimeOfDate(Date date)

Here you can find the source of firstTimeOfDate(Date date)

Description

first Time Of Date

License

Open Source License

Declaration

public static Date firstTimeOfDate(Date date) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date firstTimeOfDate(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(date.getTime());

        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);

        Date dateBegin = new Date();
        dateBegin.setTime(calendar.getTimeInMillis());
        return dateBegin;
    }/*  ww w. j  a v a2  s  .  c  o m*/
}

Related

  1. shortDate(Date date)
  2. time(Date date)
  3. toDateTime(Date date, Date time)
  4. offsetDate(Date date, int field, int offset)
  5. changeDate(String argDate)
  6. resetTime(Date date)
  7. removeTime(Date date)