Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.TimeZone; public class Main { public static String getTimeStamp() { Calendar calendar = Calendar.getInstance(TimeZone.getDefault()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); simpleDateFormat.setTimeZone(TimeZone.getDefault()); return simpleDateFormat.format(calendar.getTime()); } }