import java.util.Date; import org.apache.commons.lang.time.DateFormatUtils; public class MainClass { public static void main(String[] args) { //Format milliseconds in long using UTC timezone System.out.println("5) MM/dd/yy HH:mm >>>" + DateFormatUtils.formatUTC(System.currentTimeMillis(), "MM/dd/yy HH:mm")); } }
5) MM/dd/yy HH:mm >>>05/09/07 19:54