//This method converts timestamp to int which gives minutes public static int getTimeinMin(Timestamp tmp) { int min; int hh = tmp.getHours(); int mm = tmp.getMinutes(); int ss = tmp.getSeconds(); if (ss > 0) min = hh * 60 + mm + 1; else min = hh * 60 + mm; return min; } //This method converts timestamp to int which gives seconds public static int getTimeinSec(Timestamp tmp) { int hh = tmp.getHours(); int mm = tmp.getMinutes(); int ss = tmp.getSeconds(); return (hh * 3600 + mm * 60 + ss); } //This method updates a given timestamp with the passed minutes public static Timestamp getUpdatedTime(Timestamp temp, int min) { long mili = temp.getTime(); long addmili = min * 60 * 1000; Timestamp now = new Timestamp(mili + addmili); return now; }