Java Parse Date parseDate(String s)

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

Description

parse Date

License

Open Source License

Declaration

public final static Date parseDate(String s) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright (c) 2013,2014 by Peter Pilgrim, Addiscombe, Surrey, XeNoNiQUe UK
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU GPL v3.0
 * which accompanies this distribution, and is available at:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 *
 * Developers:/* w ww. j a  v a 2s. c o m*/
 * Peter Pilgrim -- design, development and implementation
 *               -- Blog: http://www.xenonique.co.uk/blog/
 *               -- Twitter: @peter_pilgrim
 *
 * Contributors:
 *
 *******************************************************************************/

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    private final static SimpleDateFormat FORMATTER = new SimpleDateFormat("yyyyMMdd-hh:mm:ss Z");

    public final static Date parseDate(String s) {
        try {
            Date date = FORMATTER.parse(s);
            return date;
        } catch (Exception e) {
            throw new RuntimeException("unable parse date time from string [" + s + "]", e);
        }
    }
}

Related

  1. parseDate(String representedValue)
  2. parseDate(String s)
  3. parseDate(String s)
  4. parseDate(String s)
  5. parseDate(String s)
  6. parseDate(String s)
  7. parseDate(String s)
  8. parseDate(String s)
  9. parseDate(String s)