Android Date String to Date Convert parse(String aFormat, String date)

Here you can find the source of parse(String aFormat, String date)

Description

parse

License

Apache License

Declaration

public static long parse(String aFormat, String date) 

Method Source Code

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

import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {
    public static long parse(String aFormat, String date) {
        SimpleDateFormat format = new SimpleDateFormat(aFormat);
        try {/*ww  w . j a va2s  .c o m*/
            return format.parse(date).getTime();
        } catch (ParseException e) {
            e.printStackTrace();
            return 0;
        }
    }
}

Related

  1. dateToString(Date date, String format)
  2. parseStringToDate(String dateString, String sourceDateFormat, Locale locale)
  3. parse2Date(SimpleDateFormat s, Object d)
  4. stringToDate(String src, String format)
  5. toDateFromLongFormat(String date)
  6. getDate(String date)
  7. getDateFromString(String dateStr, String pattern)
  8. getDateFromString(String string)
  9. getDateObj(String argsDate, String split)