Android Time Parse parseTime(String time)

Here you can find the source of parseTime(String time)

Description

parse Time

Declaration

public static long parseTime(String time) 

Method Source Code

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

public class Main {
    public static final String TIME_FORMAT = "HH:mm";

    public static long parseTime(String time) {
        return parse(TIME_FORMAT, time);
    }/*from  w  w  w . j a v a  2  s.com*/

    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. isRFC3339Date(String date)
  2. parseTimeString(final String time)
  3. str2Time(String str)
  4. str2TimeMillis(String str)
  5. time(String tag)