Java Today getTodayZero()

Here you can find the source of getTodayZero()

Description

get Today Zero

License

Open Source License

Declaration

public static Date getTodayZero() 

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 getTodayZero() {
        Calendar c = Calendar.getInstance();
        c.setTime(new Date());
        c.set(Calendar.HOUR_OF_DAY, 0);
        c.set(Calendar.MINUTE, 0);
        c.set(Calendar.SECOND, 0);
        return c.getTime();
    }//from  w w  w. ja  va 2  s  .  c  o  m

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

Related

  1. getTodayTimeForDB()
  2. getTodayWithTime(final String iTime)
  3. getTodayYMD()
  4. getTodayYmd()
  5. getTodayZero()
  6. getTodayZeroHour()
  7. getTommorrow(String today)
  8. getYestoday()
  9. getYestoday(String sourceDate, String format)