Java Parse Date parseDate(String date)

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

Description

Parses a textual representation of a Date based on the XMPP standard format and returns a Date.

License

Open Source License

Parameter

Parameter Description
date the textual representation.

Exception

Parameter Description
ParseException if the text cannot be parsed.

Return

the parsed Date

Declaration

public static Date parseDate(String date) throws ParseException 

Method Source Code

//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);
        }
    }
}

Related

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