Here you can find the source of getTimeSystem(String formatTime)
public static String getTimeSystem(String formatTime) throws Exception
//package com.java2s; //License from project: Open Source License public class Main { public static String getTimeSystem(String formatTime) throws Exception { String timeSystem = null; try {/*from www . j av a2s . c o m*/ if (formatTime == null) { formatTime = "HH:mm:ss"; } java.text.SimpleDateFormat format = new java.text.SimpleDateFormat(formatTime); java.util.Date date = new java.util.Date(); timeSystem = format.format(date); } catch (Exception e) { throw new Exception("Formato ora non valido"); } return timeSystem; } }