Java Date Format formatDate(Date d)

Here you can find the source of formatDate(Date d)

Description

format Date

License

Open Source License

Declaration

public static synchronized String formatDate(Date d) 

Method Source Code

//package com.java2s;
/*//from  w ww . ja  v  a  2  s .  c  om
 * Copyright (C) ${year} Omry Yadan <${email}>
 * All rights reserved.
 *
 * See https://github.com/omry/banana/blob/master/BSD-LICENSE for licensing information
 */

import java.text.SimpleDateFormat;
import java.util.*;

public class Main {
    static SimpleDateFormat s_df;

    public static synchronized String formatDate(long ms) {
        return formatDate(new Date(ms));
    }

    public static synchronized String formatDate(Date d) {
        if (s_df == null)
            s_df = new SimpleDateFormat("dd MMM yyyy HH:mm:ss zzz");

        return s_df.format(d);
    }
}

Related

  1. formatDate(ArrayList list)
  2. formatDate(Date _date)
  3. formatDate(Date aDate)
  4. formatDate(Date d)
  5. formatDate(Date d)
  6. formatDate(Date d)
  7. formatDate(Date d)
  8. formatDate(Date d)
  9. formatDate(Date d)