Android Time Parse str2Time(String str)

Here you can find the source of str2Time(String str)

Description

str Time

Declaration

public static String str2Time(String str) 

Method Source Code

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

import java.util.Date;

import java.util.Locale;

public class Main {
    public static String str2Time(String str) {
        SimpleDateFormat sdf = new SimpleDateFormat(
                "EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);
        Date date = null;//from   ww w.  j  a va2  s.c om
        try {
            date = (Date) sdf.parse(str);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        String formatStr = new SimpleDateFormat("HH:mm").format(date);
        return formatStr;
    }
}

Related

  1. isRFC3339Date(String date)
  2. parseTime(String time)
  3. parseTimeString(final String time)
  4. str2TimeMillis(String str)
  5. time(String tag)
  6. toModifiedTimeDate(double modDouble)
  7. toModifiedTimeDate(String modified)