Java Long Number to Time addMinTime(long time, String addMin)

Here you can find the source of addMinTime(long time, String addMin)

Description

add Min Time

License

Apache License

Declaration

public static String addMinTime(long time, String addMin) 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {

    public static String addMinTime(long time, String addMin) {
        if (addMin.contains("m")) {
            addMin = addMin.replace("m", "");
        }//from w  w w .  j  a  v a 2  s .  c o  m
        long ad = Long.valueOf(addMin);
        long i = ad * 60 * 1000;
        return getDateByLongTime(time + i);
    }

    public static String getDateByLongTime(long time) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        Date dt = new Date(time);
        String timeStr = sdf.format(dt);
        return timeStr;
    }
}

Related

  1. calcTime(final long totalTime)
  2. convertLong2String(Long time, String format)
  3. convertLongDate(long lDate, String format)
  4. convertLongTimeStampToString(long localTimeStamp)