public final class DateUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DATE_yyyMMddTHHmmssZ
variable DATE_yyyMMddTHHmmssZ (Date format without milliseconds)
|
static String |
DATE_yyyMMddTHHmmssZone
variable DATE_yyyyMMddTHHmmssSSSZone (Date format with milliseconds)
|
static String |
DATE_yyyyMMddTHHmmssSSSZ
variable DATE_YYYYMMDDTHHMMSS_SSSZ
|
static String |
DATE_yyyyMMddTHHmmssSSSZone
variable DATE_yyyyMMddTHHmmssSSSZone
|
Modifier and Type | Method and Description |
---|---|
static Date |
getCurrentDateTime()
Method to get the current date time Calendar instance
|
static Date |
getDateFromString(String date)
Note: The below method uses date formats that are supported by Java SE 1.6 since we still
need to support it.
|
static Date |
getDateWithNextDays(int noOfDays)
Method to get the Date instance for the given days to be added to the current date
|
static Date |
getDateWithPrevDays(int noOfDays)
Method to get the Date instance for the given days to be subtracted to the current date
|
static DateUtils |
getInstance()
Method to get the date utils instance
|
static String |
getStringFromDateTime(Date date)
Method to convert the given Date to String format
|
public static final String DATE_yyyyMMddTHHmmssSSSZ
public static final String DATE_yyyMMddTHHmmssZ
public static final String DATE_yyyyMMddTHHmmssSSSZone
public static final String DATE_yyyMMddTHHmmssZone
public static DateUtils getInstance()
public static Date getDateFromString(String date) throws ParseException
ParseException
public static Date getCurrentDateTime() throws ParseException
ParseException
public static Date getDateWithNextDays(int noOfDays) throws ParseException
noOfDays
- ParseException
public static Date getDateWithPrevDays(int noOfDays) throws ParseException
noOfDays
- ParseException
public static String getStringFromDateTime(Date date) throws ParseException
date
- the java.util.DateParseException
Copyright © 2017. All rights reserved.