Here you can find the source of addHour(String now)
public static String addHour(String now)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String addHour(String now) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); Date dt;/*from ww w. j a v a 2s . co m*/ try { dt = format.parse(now); Calendar calendar = Calendar.getInstance(); calendar.setTime(dt); calendar.add(Calendar.HOUR, 1); return format.format(calendar.getTime()); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); return ""; } } }