Here you can find the source of getCurrentDateAndTimeFormat()
Parameter | Description |
---|---|
aDate | a parameter |
public static String getCurrentDateAndTimeFormat()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/* w ww .j a v a2 s. c om*/ * * @param aDate * @return * */ /*==================================================================*/ public static String getCurrentDateAndTimeFormat() { SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd hh:mm z"); Date currentDate = new Date(System.currentTimeMillis()); String myFormattedDate = myFormatter.format(currentDate); return myFormattedDate; } }