Java Date Convert convertZeroHourDate(Date source)

Here you can find the source of convertZeroHourDate(Date source)

Description

convert Zero Hour Date

License

Apache License

Declaration

public static Date convertZeroHourDate(Date source) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {

    public static Date convertZeroHourDate(Date source) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(source);//from   w  w  w .  j av a2 s  . c  o  m
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
    }
}

Related

  1. convertToDate(String source)
  2. convertToDateStamp(long time)
  3. convertToDateTime(String source)
  4. convertToStartOfDay(Date date)
  5. convertTweetDateToLong(String date)
  6. dateToCal(Date date)
  7. dateToEnglishString(java.util.Date date)
  8. dateToFMDate(Date date)
  9. dateToInt(Date date)