Here you can find the source of getCurrentTime()
protected static String getCurrentTime()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { protected static String getCurrentTime() { SimpleDateFormat fmt = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", Locale.US); fmt.setTimeZone(TimeZone.getTimeZone("GMT")); return fmt.format(new Date()); }/*w w w . j av a2 s . c o m*/ }