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("h:mm aa dd-M-yyyy"); simpleDateFormat.setTimeZone(TimeZone.getDefault()); return simpleDateFormat.format(calendar.getTime()); } }