Java Time Format getFormattedTime()

Here you can find the source of getFormattedTime()

Description

get Formatted Time

License

Apache License

Declaration

public static String getFormattedTime() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static String getFormattedTime() {
        DateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
        return format.format(new Date());
    }/*from ww  w  .  j  av  a  2  s  .  co m*/

    public static String getFormattedTime(String withFormat) {
        DateFormat format = new SimpleDateFormat(withFormat);
        return format.format(new Date());
    }
}

Related

  1. getFormattedDateAndTime(final Date date)
  2. getFormattedDateTime(Date date, String pattern)
  3. getFormattedDateTime(String date, String dateFormat)
  4. getFormattedDuration(long fromTime)
  5. getFormattedFileTime(File f, String format)
  6. getFormattedTime(Date date)
  7. getFormattedTime(Date date)
  8. getFormattedTime(final Calendar calendar)
  9. getFormattedTime(final Date date)