Java tutorial
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { /** * Get the current date as a string * @return Current time */ public static String getNow() { return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).format(new Date()); } }