Java Parse Date Pattern YYYY parse(String s)

Here you can find the source of parse(String s)

Description

start="20100110175500 +0100"

License

Open Source License

Parameter

Parameter Description
date with format : 20100110175500 +0100

Return

corresponding time, not in milliseconds but in minutes, origin at 1970/01/01

Declaration

public static int parse(String s) throws ParseException 

Method Source Code


//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);
    }
}

Related

  1. parse(String s)
  2. parse(String s)
  3. parse(String s)
  4. parse(String s)
  5. parse(String s)
  6. parse(String s, String formatPattern)
  7. parse(String source)
  8. parse(String source)
  9. parse(String source)