Android Date Today Get getTodayEndTime()

Here you can find the source of getTodayEndTime()

Description

get Today End Time, "yyyy-MM-dd HH:mm"

Declaration

public static long getTodayEndTime() 

Method Source Code

//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    private static final String FORMAT_DATE_YYYY_MM_DD = "yyyy-MM-dd";
    private static final String FORMAT_DATE_AND_TIME_YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm";

    public static long getTodayEndTime() {
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat(FORMAT_DATE_YYYY_MM_DD);
        String strDate = sdf.format(date);
        Date date2 = null;/*from   w  w  w .  j a  va2  s .  com*/
        try {
            date2 = sdf.parse(strDate);
            SimpleDateFormat sdf2 = new SimpleDateFormat(
                    FORMAT_DATE_AND_TIME_YYYY_MM_DD_HH_MM);
            String strDate2 = sdf2.format(date2);
            Date date3 = sdf2.parse(strDate2);
            return date3.getTime() + 86399000;
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return 0;
    }
}

Related

  1. getDateToday()
  2. getSystemDate()
  3. getToday()
  4. getTodayDateString()
  5. getTodayStartTime()
  6. today()
  7. todayWithHour()
  8. getDate()