public final class DateTimeUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Date |
getDateFromString(String dateString,
String dateFormatString)
Takes a date in string format and a date format string and returns
a Date
|
static Date |
getDateRelativeToNow(TimeUnit timeUnit,
long amount)
Builds and returns a date that is a specified amount of time away from now (earlier or later).
|
static String |
getStringFromDate(Date date,
String dateFormatString)
Takes a date and a date format string and returns a string
of the date formatted according to the passed in arguments
|
static boolean |
isDateInRange(Date dateToCheck,
Date startDate,
Date endDate)
Returns weather the date is within a given range.
|
static Date |
parseExact(String value,
String format)
Given the format value parse the date time from the string.
|
public static Date parseExact(String value, String format) throws ParseException
value - format - ParseExceptionpublic static String getStringFromDate(Date date, String dateFormatString)
date - - date to turn into a stringdateFormatString - - string specifying how the date is to be
formatted into a stringpublic static Date getDateFromString(String dateString, String dateFormatString)
dateString - - the date in a string representationdateFormatString - - the format of how the date is represented in the
dateString argumentpublic static boolean isDateInRange(Date dateToCheck, Date startDate, Date endDate)
Copyright © 2019 Electronic Arts Inc. All rights reserved.