public class DateUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DATE_FORMAT_NOW
Format for date.
|
static java.lang.String |
DATETIME_FORMAT_NOW
Format for date and time.
|
static java.lang.String |
DAY
Format for day
|
static java.lang.String |
HOUR
Format for hour.
|
static java.lang.String |
MINUTES
Format for minutes.
|
static java.lang.String |
MONTH
Format for month.
|
static java.lang.String |
SECONDS
Format for seconds.
|
static java.lang.String |
TIME_FORMAT_NOW
Format for time.
|
static java.lang.String |
YEAR
Format for year.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getDateAndTimeNow()
Retrieves the current date and time in format yyyy-MM-dd HH:mm:ss.
|
static java.lang.String |
getDateNow()
Retrieves the current date in format yyyy-MM-dd.
|
static java.lang.String |
getDateString(java.util.Date date)
Retrieves the given date in format yyyy-MM-dd HH:mm:ss.
|
static java.lang.String |
getDay()
Retrieves the current day in format dd.
|
static java.lang.String |
getHour()
Retrieves the current hour in format HH.
|
static java.lang.String |
getMinutes()
Gets the current minutes in format mm.
|
static java.lang.String |
getMonth()
Retrieves the current month in format MM.
|
static java.lang.String |
getMonthName()
Retrieves the month name of the current month.
|
static java.lang.String |
getMonthName(int month)
Retrieves the month name of the given month number.
|
static java.lang.String |
getSeconds()
Gets the current seconds in format ss.
|
static java.lang.String |
getTimeNow()
Retrieves the current time in format HH:mm:ss.
|
static java.lang.String |
getYear()
Retrieves the current year in format yyyy.
|
static java.lang.String |
isoDateNow()
Retrieves an ISO8601 date string of the current time.
|
static java.util.Date |
isoDateStringToDate(java.lang.String text)
Converts the given ISO8601 date string into a date object.
|
public static final java.lang.String DATE_FORMAT_NOW
public static final java.lang.String DATETIME_FORMAT_NOW
public static final java.lang.String DAY
public static final java.lang.String HOUR
public static final java.lang.String MINUTES
public static final java.lang.String MONTH
public static final java.lang.String SECONDS
public static final java.lang.String TIME_FORMAT_NOW
public static final java.lang.String YEAR
public static java.lang.String getDateAndTimeNow()
public static java.lang.String getDateNow()
public static java.lang.String getDateString(java.util.Date date)
date - Date to get as string.public static java.lang.String getDay()
public static java.lang.String getHour()
public static java.lang.String getMinutes()
public static java.lang.String getMonth()
public static java.lang.String getMonthName()
public static java.lang.String getMonthName(int month)
month - Month number to retrieve its name.public static java.lang.String getSeconds()
public static java.lang.String getTimeNow()
public static java.lang.String getYear()
public static java.lang.String isoDateNow()
public static java.util.Date isoDateStringToDate(java.lang.String text)
text - ISO8601 date string to convert.© Copyright 2014 Etherios, Inc. All rights reserved. Etherios, Inc. is a Division of Digi International Inc.