Java yyyy format(Date aTs_Datetime)

Here you can find the source of format(Date aTs_Datetime)

Description

format

License

Apache License

Declaration

public static String format(Date aTs_Datetime) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String format(Date aTs_Datetime) {
        return format(aTs_Datetime, "yyyy-MM-dd");
    }/*from   w  w  w.j av a  2 s  .  com*/

    public static String format(Date aTs_Datetime, String as_Pattern) {
        if (aTs_Datetime == null || as_Pattern == null)
            return null;

        SimpleDateFormat dateFromat = new SimpleDateFormat();
        dateFromat.applyPattern(as_Pattern);

        return dateFromat.format(aTs_Datetime);
    }
}

Related

  1. format()
  2. format(Date date)
  3. format(Date date)
  4. format(Date date)
  5. format(Date date)