Java Date Now getCurrentDayBegin()

Here you can find the source of getCurrentDayBegin()

Description

get Current Day Begin

License

Open Source License

Declaration

public static Date getCurrentDayBegin() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    private final static SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static Date getCurrentDayBegin() {
        Calendar calendar = new GregorianCalendar();
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        return calendar.getTime();
    }// w w  w  . j av  a  2s  .com

    public static String getTime() {
        return sdfTime.format(new Date());
    }
}

Related

  1. getCurrentDay()
  2. getCurrentDay()
  3. getCurrentDay()
  4. getCurrentDay(int model)
  5. getCurrentDay(String pattern)
  6. getCurrentDayInyyyyMMdd()
  7. getCurrentFormattedTime()
  8. getCurrentGMTTime()
  9. getCurrentHMS()