Here you can find the source of getNowTime()
public static String getNowTime()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Locale; public class Main { private final static Calendar nowCalendar = Calendar.getInstance(); public static String getNowTime() { SimpleDateFormat dateFormat = new SimpleDateFormat("a hh:mm:ss ", Locale.CHINA); dateFormat.setCalendar(nowCalendar); return dateFormat.format(nowCalendar.getTime()); }// www . jav a 2 s . c o m }