Here you can find the source of getRunningTime(Date date, SimpleDateFormat sday, String line)
Parameter | Description |
---|---|
date | a parameter |
sday | a parameter |
line | a parameter |
Parameter | Description |
---|---|
ParseException | an exception |
public static Date getRunningTime(Date date, SimpleDateFormat sday, String line) throws ParseException
//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); } }