Java Date Now getCurrentFormattedTime()

Here you can find the source of getCurrentFormattedTime()

Description

get Current Formatted Time

License

Open Source License

Declaration

public static String getCurrentFormattedTime() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static final String TIME_FORMAT = "HH:mm:ss";

    public static String getCurrentFormattedTime() {
        return getFormattedTime(new Date());
    }// ww w .  j  a v  a2 s . com

    public static String getFormattedTime(Date time) {
        return new SimpleDateFormat(TIME_FORMAT).format(time);
    }
}

Related

  1. getCurrentDay()
  2. getCurrentDay(int model)
  3. getCurrentDay(String pattern)
  4. getCurrentDayBegin()
  5. getCurrentDayInyyyyMMdd()
  6. getCurrentGMTTime()
  7. getCurrentHMS()
  8. getCurrentISO8601Date()
  9. getCurrentJnlpTimestamp()