Java Second Format getIntervalMilSeconds(String startDateStr, String endDateStr, String dateFormat)

Here you can find the source of getIntervalMilSeconds(String startDateStr, String endDateStr, String dateFormat)

Description

get Interval Mil Seconds

License

Open Source License

Declaration

public static long getIntervalMilSeconds(String startDateStr, String endDateStr, String dateFormat)
        throws ParseException 

Method Source Code


//package com.java2s;
/*// www. j  a  va 2s . co m
 * Copyright 1998-2012 360buy.com All right reserved. This software is the confidential and proprietary information of
 * 360buy.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the license agreement you entered into with 360buy.com.
 */

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static long getIntervalMilSeconds(String startDateStr, String endDateStr, String dateFormat)
            throws ParseException {
        SimpleDateFormat format = new SimpleDateFormat(dateFormat);
        Date startDate = format.parse(startDateStr);
        Date endDate = format.parse(endDateStr);
        return endDate.getTime() - startDate.getTime();
    }
}

Related

  1. getElapsedSeconds(long startTime)
  2. getFormatMSecond(long long_)
  3. getFormattedDuration(int simTimeSeconds)
  4. getFullDateByMisSecond(long misSecond)
  5. getFutureDate(int seconds)
  6. getMisSecond(String strDate)
  7. getSecond()
  8. getSecond()
  9. getSecond()