Package com.restfb.util
Class DateUtils
java.lang.Object
com.restfb.util.DateUtils
A collection of date-handling utility methods.
- Since:
- 1.6
- Author:
- Mark Allen
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringFacebook alternate short date format.static final StringFacebook "long" date format (IETF RFC 3339).static final StringFacebook "long" date format (IETF RFC 3339) without a timezone component.static final StringFacebook "long" date format (IETF RFC 3339) without a timezone or seconds component.static final StringFacebook month-year only date format.static final StringFacebook short date format.
- 
Method SummaryModifier and TypeMethodDescriptionstatic DateFormatStrategyget the current DateFormatStrategy.static voidsetDateFormatStrategy(DateFormatStrategy dateFormatStrategy) set theDateFormatStrategy.static DatetoDateFromLongFormat(String date) Returns a Java representation of a Facebook "long"datestring, or the number of seconds since the epoch.static DateReturns a Java representation of a Facebook "month-year"datestring.static DatetoDateFromShortFormat(String date) Returns a Java representation of a Facebook "short"datestring.static StringtoLongFormatFromDate(Date date) Returns a String representation of adateobjectstatic StringtoShortFormatFromDate(Date date) Returns a short String representation of adateobject
- 
Field Details- 
FACEBOOK_LONG_DATE_FORMATFacebook "long" date format (IETF RFC 3339). Example:2010-02-28T16:11:08+0000- See Also:
 
- 
FACEBOOK_LONG_DATE_FORMAT_WITHOUT_TIMEZONEFacebook "long" date format (IETF RFC 3339) without a timezone component. Example:2010-02-28T16:11:08- See Also:
 
- 
FACEBOOK_LONG_DATE_FORMAT_WITHOUT_TIMEZONE_OR_SECONDSFacebook "long" date format (IETF RFC 3339) without a timezone or seconds component. Example:2010-02-28T16:11- See Also:
 
- 
FACEBOOK_SHORT_DATE_FORMATFacebook short date format. Example:04/15/1984- See Also:
 
- 
FACEBOOK_ALTERNATE_SHORT_DATE_FORMATFacebook alternate short date format. Example:2012-09-15- See Also:
 
- 
FACEBOOK_MONTH_YEAR_DATE_FORMATFacebook month-year only date format. Example:Example: 2007-03- See Also:
 
 
- 
- 
Method Details- 
toDateFromLongFormatReturns a Java representation of a Facebook "long"datestring, or the number of seconds since the epoch.Supports dates with or without timezone information. - Parameters:
- date- Facebook- datestring.
- Returns:
- Java date representation of the given Facebook "long" datestring ornullifdateisnullor invalid.
 
- 
toDateFromShortFormatReturns a Java representation of a Facebook "short"datestring.- Parameters:
- date- Facebook- datestring.
- Returns:
- Java date representation of the given Facebook "short" datestring ornullifdateisnullor invalid.
 
- 
toDateFromMonthYearFormatReturns a Java representation of a Facebook "month-year"datestring.- Parameters:
- date- Facebook- datestring.
- Returns:
- Java date representation of the given Facebook "month-year" datestring ornullifdateisnullor invalid.
 
- 
toLongFormatFromDateReturns a String representation of adateobject- Parameters:
- date- as Date
- Returns:
- String representation of a dateobject. The String is in the form2010-02-28T16:11:08
 
- 
toShortFormatFromDateReturns a short String representation of adateobject- Parameters:
- date- as Date
- Returns:
- String representation of a dateobject. The String is in the form2019-06-14
 
- 
getDateFormatStrategyget the current DateFormatStrategy.- Returns:
- the current DateFormatStrategy
 
- 
setDateFormatStrategyset theDateFormatStrategy.default value: SimpleDateFormatStrategy- Parameters:
- dateFormatStrategy- the used- DateFormatStrategy
 
 
-