Java Day of getRunningTime(Date date, SimpleDateFormat sday, String line)

Here you can find the source of getRunningTime(Date date, SimpleDateFormat sday, String line)

Description

Gets the time the app was running for each day

License

Open Source License

Parameter

Parameter Description
date a parameter
sday a parameter
line a parameter

Exception

Parameter Description
ParseException an exception

Return

date

Declaration

public static Date getRunningTime(Date date, SimpleDateFormat sday, String line) throws ParseException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

import java.util.Date;

public class Main {
    /**/*  www  .  j a  va  2 s .  c  o  m*/
     * Gets the time the app was running for each day
     * @param date
     * @param sday
     * @param line
     * @return date
     * @throws ParseException
     */
    public static Date getRunningTime(Date date, SimpleDateFormat sday, String line) throws ParseException {
        long diff = (date.getTime() - sday.parse(line).getTime()) - 60 * 60 * 1000;
        return new Date(diff);
    }
}

Related

  1. getLatest7Day()
  2. getNDayAfterCurrentDate(String dateStr, String dateFormat, int n)
  3. getOtherDayLastUpdateTimeFormat()
  4. getPaxBirthday()
  5. getPriorDay(int offset, String pattern)
  6. getSetDate(Date dt, int dayNum)
  7. getSignContinusDay(Date lastSignTime)
  8. getSpcilNumDayArray(Date startDate, int num)
  9. getSpecifiedDayAfter(String specifiedDay)