public final class BoxDateFormat extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
format(Date date)
Formats a date as a string that can be sent to the Box API.
|
static String |
format(Instant instant)
Formats an Instant as a string that can be sent to the Box API.
|
static String |
formatAsDateOnly(Date date)
Formats a date as a string yyyy-MM-dd that can be sent to the Box API.
|
static Date |
parse(String dateString)
Parses a date string returned by the Box API into a
Date object. |
static Date |
parseDateOnly(String date)
Parses a date in format of yyyy-MM-dd.
|
public static Date parse(String dateString) throws ParseException
Date object.dateString - a string containing the date.ParseException - if the string cannot be parsed into a valid date.public static Date parseDateOnly(String date) throws ParseException
date - date to parse.ParseException - if the string cannot be parsed into a valid date.public static String format(Date date)
date - the date to format.public static String format(Instant instant)
instant - the instant to format.public static String formatAsDateOnly(Date date)
date - the date to format.