Here you can find the source of parseISO(String aIsoString)
Parameter | Description |
---|---|
aIsoString | a parameter |
Parameter | Description |
---|---|
ParseException | an exception |
public static Date parseISO(String aIsoString) throws ParseException
//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"); } }