Android Hour Add addHourTime(int hour)

Here you can find the source of addHourTime(int hour)

Description

add Hour Time

Declaration

public static String addHourTime(int hour) 

Method Source Code

//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Calendar;

import java.util.GregorianCalendar;

public class Main {
    public static String addHourTime(int hour) {
        GregorianCalendar gcalendar = new GregorianCalendar();
        gcalendar.add(Calendar.HOUR, hour);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        return sdf.format(gcalendar.getTime());
    }/*from  ww w  .  j  a  v  a  2s  .co  m*/
}