Here you can find the source of parse(String s)
Parameter | Description |
---|---|
date | with format : 20100110175500 +0100 |
public static int parse(String s) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { private static final DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss Z"); /**/* w w w .j a v a 2s . com*/ * start="20100110175500 +0100" * @param date with format : 20100110175500 +0100 * @return corresponding time, not in milliseconds but in minutes, origin at 1970/01/01 */ public static int parse(String s) throws ParseException { return (int) (df.parse(s).getTime() / 1000 / 60); } }