Here you can find the source of parseDate(String date)
Parameter | Description |
---|---|
date | the textual representation. |
Parameter | Description |
---|---|
ParseException | if the text cannot be parsed. |
public static Date parseDate(String date) throws ParseException
//package com.java2s; /*//from www . j a va 2s. c om * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; public class Main { public static final SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); /** * Parses a textual representation of a Date based on the XMPP standard * format and returns a Date. * * @param date the textual representation. * @return the parsed Date * @throws ParseException if the text cannot be parsed. */ public static Date parseDate(String date) throws ParseException { synchronized (UTC_FORMAT) { return UTC_FORMAT.parse(date); } } }