Java tutorial
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getDateTime() { Date date = new Date(); return getDateTime(date); } public static String getDateTime(Date spawnDate) { DateFormat dateFormat = new SimpleDateFormat("EEE, dd, MMM yyyy hh:mm:ss Z"); return dateFormat.format(spawnDate); } }