Java Day of getCurDayZero()

Here you can find the source of getCurDayZero()

Description

get Cur Day Zero

License

Apache License

Declaration

public static String getCurDayZero() 

Method Source Code


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

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {

    public static String getCurDayZero() {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        return new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(calendar.getTime());
    }/* w  w  w  .j av  a  2  s  .  com*/

    public static long getTime(String s) {
        return parseMysql(s).getTime();
    }

    public static Date parseMysql(String s) {
        try {
            DateFormat fmtTemp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            return fmtTemp.parse(s);
        } catch (ParseException e) {
            return null;
        }
    }
}

Related

  1. getBirthDayDateFormat()
  2. getBirthdayFormatStr(Date date)
  3. getBookInfoDate(int days)
  4. getCalendarByDay(String dayStr)
  5. getConfirmDateTimeOfDay(Date currentDate)
  6. getDataFile(int tableId, Date day)
  7. getDataTimeForwordDay(Date date, int dayNum)
  8. getDefaultOffsetDays(String strDate)
  9. getDeltaDay(String day, int delta)