Java tutorial
//package com.java2s; import java.util.*; import java.text.SimpleDateFormat; public class Main { public static String getTime() { Date currentDate = Calendar.getInstance(TimeZone.getTimeZone("JST"), Locale.getDefault()).getTime(); /** SimpleDateFormat formatter = new SimpleDateFormat("EEE MMM dd hh:mm:ss yyyy", Locale.getDefault()); **/ SimpleDateFormat formatter = new SimpleDateFormat("EEE MMM dd hh:mm:ss yyyy", Locale.getDefault()); return formatter.format(currentDate); } }