Android Date String Parse parseDate(String date)

Here you can find the source of parseDate(String date)

Description

parse Date

Declaration

public static long parseDate(String date) 

Method Source Code

//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {
    public static final String DATE_FORMAT = "yyyy-MM-dd";

    public static long parseDate(String date) {
        return parse(DATE_FORMAT, date);
    }/*from w  w w . j  ava  2  s.c  o  m*/

    public static long parse(String pattern, String date) {
        final SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        try {
            return sdf.parse(date).getTime();
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return 0;
    }
}

Related

  1. convertDateTimeStrFormat(String dateStr, String pattern, String newPattern)
  2. convertStringToDate(String strDate, String pattern)
  3. parse(String pattern, String date)
  4. parse3339(String time)
  5. parseDate(String date)
  6. parseDate(String rawDate)
  7. parseDateStr(String dateStr, String srcPattern, String destPattern)
  8. parseDateString(String dateStr, String pattern)
  9. parseDateString(String dateStr, String pattern, Locale locale)