Here you can find the source of getCurrentTimeOfDay()
public static String getCurrentTimeOfDay()
//package com.java2s; /******************************************************************************* * <copyright> Copyright (c) 2014-2016 Bauhaus Luftfahrt e.V.. All rights reserved. This program and the accompanying * materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html </copyright> ******************************************************************************/ import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/* w w w .j av a 2 s .co m*/ * Delivers the current time in HH:mm:ss format. * * @return the current time as HH:mm:ss String */ public static String getCurrentTimeOfDay() { return new SimpleDateFormat("HH:mm:ss").format(new Date()); } }