Return to Snippet

Revision: 13088
at April 8, 2009 05:20 by walokra


Initial Code
/**
 * Get the time in defined format
 * 
 * @return String with time
 */
 public static String getTime() {
     String DATE_FORMAT_NOW = "HH:mm:ss";
     Calendar cal = Calendar.getInstance();
     SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
     return sdf.format(cal.getTime());
 }

Initial URL


Initial Description


Initial Title
Get the time in defined format

Initial Tags
date, java

Initial Language
Java