Java Date Now currentDate()

Here you can find the source of currentDate()

Description

Returns the current date formatted as EXIF timestamp.

License

GNU General Public License

Return

A String object containing the current date.

Declaration

public static String currentDate() 

Method Source Code

//package com.java2s;
// License: GPL. For details, see LICENSE file.

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;

public class Main {
    /**/*ww w .j  a  v  a 2s  .c o  m*/
     * Returns the current date formatted as EXIF timestamp.
     * As timezone the default timezone of the JVM is used ({@link java.util.TimeZone#getDefault()}).
     *
     * @return A {@code String} object containing the current date.
     */
    public static String currentDate() {
        return new SimpleDateFormat("yyyy:MM:dd HH:mm:ss", Locale.UK).format(Calendar.getInstance().getTime());
    }
}

Related

  1. currentAfterDay(Date date)
  2. currentDate()
  3. currentDate()
  4. currentDate()
  5. currentDate()
  6. currentDate()