Here you can find the source of parseSipDateTime(String dateStr)
Parameter | Description |
---|---|
dateStr | date and time in SIP2 format |
public static Date parseSipDateTime(String dateStr)
//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; } } }