Java Parse Date Pattern YYYY parse(Long time)

Here you can find the source of parse(Long time)

Description

parse

License

Apache License

Declaration

public static Date parse(Long time) 

Method Source Code

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

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

public class Main {
    public static SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");

    public static Date parse(Long time) {
        if (time == null) {
            return null;
        }//  w  ww . ja  v a2s .c  o  m
        Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(time);
        return cal.getTime();
    }

    public static String getTime(String pattern) {
        return new SimpleDateFormat(pattern).format(new Date());
    }
}

Related

  1. parse(final String inputDate)
  2. parse(final String s)
  3. parse(final String source)
  4. parse(final String source)
  5. parse(Long date)
  6. parse(Object object)
  7. parse(String calendarString)
  8. parse(String d)
  9. parse(String date)