Here you can find the source of currentDate()
public static String currentDate()
//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()); } }