Java Hour Format formattedDate()

Here you can find the source of formattedDate()

Description

formatted Date

License

Open Source License

Declaration

public static String formattedDate() 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static final DateFormat timestampFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static String formattedDate() {
        return toTimestamp(new Date());
    }//ww w  .  j  a  va  2 s . c o m

    public static String toTimestamp(Date d) {
        return timestampFormat.format(d);
    }
}

Related

  1. formatSSLValid(Date validFrom, Date validTo)
  2. formatStringTime(String dateTime)
  3. formatStringTimeToLong(String timeLine)
  4. formatStrToDate(String strDate, int format)
  5. formatStrToDate(String value, String pattern)
  6. formattedDate(java.util.Date date, String formatString)
  7. formattedDateToDate(String str)
  8. formattedStringToDate(String date)
  9. formattedTime(long epochTime)