Here you can find the source of fromIso8601(@Nullable String date)
Parameter | Description |
---|---|
date | the date in the form of a ISO-8601 string (for example: '2009-06-30T18:30:00+02:00') |
@Nullable public static Calendar fromIso8601(@Nullable String date)
//package com.java2s; /************************************************************************** * <pre>//from www . j a v a 2 s . c o m * * Copyright (c) Unterrainer Informatik OG. * This source is subject to the Microsoft Public License. * * See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL. * All other rights reserved. * * (In other words you may copy, use, change and redistribute it without * any restrictions except for not suing me because it broke something.) * * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR * PURPOSE. * * </pre> ***************************************************************************/ import java.util.Calendar; import javax.annotation.Nullable; public class Main { /** * Converts a ISO-8601 string to a {@link Calendar}-object. * * @param date the date in the form of a ISO-8601 string (for example: '2009-06-30T18:30:00+02:00') * @return the calendar */ @Nullable public static Calendar fromIso8601(@Nullable String date) { if (date == null) { return null; } return javax.xml.bind.DatatypeConverter.parseDateTime(date); } }