Here you can find the source of getNowSinceHour()
public static String getNowSinceHour()
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getNowSinceHour() { Date now = new Date(); return getNowSinceHour(now); }/*w ww. ja v a 2 s. c o m*/ public static String getNowSinceHour(Date now) { SimpleDateFormat f = new SimpleDateFormat("HH:mm:ss"); return f.format(now); } }