Java Day of getTwoDay2String(String startDate, String endDate, Format format)

Here you can find the source of getTwoDay2String(String startDate, String endDate, Format format)

Description

get Two Day String

License

Apache License

Declaration

public static String getTwoDay2String(String startDate, String endDate, Format format) 

Method Source Code


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

import java.text.Format;

import java.text.SimpleDateFormat;

public class Main {

    public static String getTwoDay2String(String startDate, String endDate, Format format) {
        SimpleDateFormat localFormat = (SimpleDateFormat) format;
        long day = 0;
        try {//www.jav a2s.  c om
            java.util.Date startDay = localFormat.parse(startDate);
            java.util.Date endDay = localFormat.parse(endDate);
            day = (endDay.getTime() - startDay.getTime()) / (24 * 60 * 60 * 1000);
        } catch (Exception e) {
            return "";
        }
        return day + "";
    }
}

Related

  1. getThursday(String date)
  2. getTimeOfDaySeconds()
  3. getTimestamp(String format, Integer daysInFuture)
  4. getTwoDay(String sj1, String sj2)
  5. getTwoDay(String sj1, String sj2)
  6. getWorkingDay(Calendar d1, Calendar d2)
  7. getYesday()
  8. getYYYY_MM_DD(int offsetDays)
  9. isBirthdayPartAvail(String number)