Java SimpleDateFormat format Date to String as "02020.February.25 AD 11:06 AM"

Description

Java SimpleDateFormat format Date to String as "02020.February.25 AD 11:06 AM"

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {

  public static void main(String[] args) {

    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyy.MMMMM.dd GGG hh:mm aaa");
    String dateAsString = simpleDateFormat.format(new Date());
    System.out.println(dateAsString);

  }/*from   w  w w  .j a v a2s  .  c  o m*/

}



PreviousNext

Related