Java tutorial
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTime() { DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); Date date = new Date(System.currentTimeMillis()); String time = df.format(date); return time; } }