Java Date Now getCurrentTimeOfDay()

Here you can find the source of getCurrentTimeOfDay()

Description

Delivers the current time in HH:mm:ss format.

License

Open Source License

Return

the current time as HH:mm:ss String

Declaration

public static String getCurrentTimeOfDay() 

Method Source Code

//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());
    }
}

Related

  1. getCurrentTimeInMySqlTime()
  2. getCurrentTimeInString(SimpleDateFormat dateFormat)
  3. getCurrentTimeInString(String format)
  4. getCurrentTimeNoHour()
  5. getCurrentTimeNumber()
  6. getCurrentTimeStamp()
  7. getCurrentTimeStamp()
  8. getCurrentTimestamp()
  9. getCurrentTimestamp()