Java Date ISO Parse parseISO(String aIsoString)

Here you can find the source of parseISO(String aIsoString)

Description

Aggiunge 12:00 per evitare problemi con CET CEST.

License

Open Source License

Parameter

Parameter Description
aIsoString a parameter

Exception

Parameter Description
ParseException an exception

Declaration

public static Date parseISO(String aIsoString) throws ParseException 

Method Source Code


//package com.java2s;
/*//  w  w w .j a  v  a  2 s.  c  o  m
Copyright (c) 2012,2013 Mirco Attocchi
       
This file is part of WebAppCommon.
    
WebAppCommon is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
    
WebAppCommon is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.
    
You should have received a copy of the GNU Lesser General Public License
along with WebAppCommon.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

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

    /**
     * Aggiunge 12:00 per evitare problemi con CET CEST. Una data 20120309
     * potrebbe diventare 2012 03 08 perche viene valorizzata con ora 00:00 e
     * quando la si formatta nel locale Italiano Java la fa diventare il giorno
     * precedente passando da CET a CEST
     * 
     * @param aIsoString
     * @return
     * @throws ParseException
     */
    public static Date parseISO(String aIsoString) throws ParseException {
        return new SimpleDateFormat(FORMAT_ISO_HHmm).parse(aIsoString + " 12:00");
    }
}

Related

  1. parseDateISO(String date)
  2. parseDateISO(String value)
  3. parseDateISO(String value)
  4. parseDateTime(String iso8061StrDateTime)
  5. parseFromIso8601(String s)
  6. parseISO(String input)
  7. parseISO(String strValue)
  8. parseIso8601(String iso8601String)
  9. parseIso8601(String rawstr)