Here you can find the source of parseDate(Long date, String format)
public static Date parseDate(Long date, String format)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static Date parseDate(Long date, String format) { if (date == null) { return null; }/*from w ww .j a va2 s.c o m*/ SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format, Locale.CHINA); try { return simpleDateFormat.parse(date + ""); } catch (ParseException e) { return null; } } public static Date parseDate(String date, String format) { if (date == null) { return null; } SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format, Locale.CHINA); try { return simpleDateFormat.parse(date + ""); } catch (ParseException e) { return null; } } }