Java Long Number to Date format(Long dateMs, String type)

Here you can find the source of format(Long dateMs, String type)

Description

format

License

Open Source License

Declaration

public static String format(Long dateMs, String type) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String format(Date aDate, String type) {
        SimpleDateFormat sdf = new SimpleDateFormat(type);

        return sdf.format(aDate);
    }/* ww w.j  a v  a  2 s.c  om*/

    public static String format(Long dateMs, String type) {
        Date date = new Date(dateMs);
        SimpleDateFormat sdf = new SimpleDateFormat(type);
        return sdf.format(date);
    }
}

Related

  1. dateToStrLong(java.util.Date dateDate, String format)
  2. format(long date)
  3. format(Long date, String pattern)
  4. format(long date, String pattern)
  5. format(long dateInMillis, String pattern)
  6. format(Long dateTmie, String formate)
  7. format(long time, SimpleDateFormat format)
  8. formatDate(final long date)
  9. formatDate(final long ticks, final SimpleDateFormat format)