Here you can find the source of getMessageCreateTime()
private static String getMessageCreateTime()
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static String getMessageCreateTime() { Date date = new Date(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); String nowTime = df.format(date); return nowTime; }// ww w .j a v a 2 s .co m }