Java Parse Date Pattern YYYY parseSipDateTime(String dateStr)

Here you can find the source of parseSipDateTime(String dateStr)

Description

Parses the date and time from the given SIP2 formatted string.

License

Open Source License

Parameter

Parameter Description
dateStr date and time in SIP2 format

Return

Date object

Declaration

public static Date parseSipDateTime(String dateStr) 

Method Source Code


//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**/* www  .  j  a v  a 2s  .c o  m*/
     * Parses the date and time from the given SIP2 formatted string. The SIP2
     * format is "yyyyMMdd    HHmmss".
     *
     * @param dateStr date and time in SIP2 format
     * @return Date object
     */
    public static Date parseSipDateTime(String dateStr) {
        SimpleDateFormat simpleDf = new SimpleDateFormat("yyyyMMdd    HHmmss");
        try {
            return simpleDf.parse(dateStr);
        } catch (ParseException pe) {
            return null;
        }
    }
}

Related

  1. parseSecureDate(final String dateString)
  2. parseSegKeyDate4Display(String source)
  3. parseSessionTime(String response)
  4. parseSilently(String p_string)
  5. parseSimpleDate(String string, Date defaultDate)
  6. parseSolrDate(String date)
  7. parseSpaydDate(String date, TimeZone tz)
  8. parseString(String date)
  9. parseString(String dateStr)