public final class DateUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FACEBOOK_LONG_DATE_FORMAT
Facebook "long" date format (ISO 8601).
|
static String |
FACEBOOK_MONTH_YEAR_DATE_FORMAT
Facebook month-year only date format.
|
static String |
FACEBOOK_SHORT_DATE_FORMAT
Facebook short date format.
|
Modifier and Type | Method and Description |
---|---|
static Date |
toDateFromLongFormat(String date)
Returns a Java representation of a Facebook "long"
date string. |
static Date |
toDateFromMonthYearFormat(String date)
Returns a Java representation of a Facebook "month-year"
date
string. |
static Date |
toDateFromShortFormat(String date)
Returns a Java representation of a Facebook "short"
date string. |
public static final String FACEBOOK_LONG_DATE_FORMAT
2010-02-28T16:11:08+0000
public static final String FACEBOOK_SHORT_DATE_FORMAT
04/15/1984
public static final String FACEBOOK_MONTH_YEAR_DATE_FORMAT
Example: 2007-03
public static Date toDateFromLongFormat(String date) throws IllegalArgumentException
date
string.date
- Facebook date
string.date
string or null
if date
is null
or invalid.IllegalArgumentException
public static Date toDateFromShortFormat(String date) throws IllegalArgumentException
date
string.date
- Facebook date
string.date
string or null
if date
is null
or invalid.IllegalArgumentException
public static Date toDateFromMonthYearFormat(String date) throws IllegalArgumentException
date
string.date
- Facebook date
string.date
string or null
if date
is null
or invalid.IllegalArgumentException
Copyright © 2014. All rights reserved.