public class DateUtils extends Object implements DateConstants
AM, AM_PM, DATE, DATE_FORMAT, DATE_TIME_FORMAT, DATE_TIME_FORMAT_NICE, dateSDF, dateTimeSDF, DAY, DF_LIST, dowSDF, DT_FORMAT, EFFECTIVE_DATE, FORTY_5_MINUTES_MILLI, HOUR, ISO_DATETIME_TIME_ZONE_FORMAT, MINUTE, MONTH, NEXT_MONTH, NEXT_WEEK, NOW, ONE_DAY_MILLI, ONE_DAY_SECONDS, ONE_HOUR_MILLI, ONE_MINUTE_MILLI, ONE_SECOND_MILLI, ONE_WEEK_MILLI, PM, PRETTY_DATE, PRETTY_DATE_FORMAT, PRETTY_DT, PRETTY_DT_FORMAT, SAT, SIMPLE_TIME_FORMAT, simpTimeSDF, SMALL_DF_LIST, standardDateSDF, SUN, TEN_MINUTES_MILLI, THIRTY_MINUTES_MILLI, THIRTY_SECOND_MILLI, TIME, TIME_FORMAT, timeSDF, TODAY, TWELVE_HOUR_MILLI, WEEK, YEAR
Constructor and Description |
---|
DateUtils() |
Modifier and Type | Method and Description |
---|---|
static long |
absoluteTimeout(double relativeTimeoutSeconds) |
static String |
formatDate(String sdfFormat,
Date date,
String defValue,
TimeZone tz) |
static String |
formatDate(String sdfFormat,
Date date,
TimeZone tz) |
static String |
getAmPm(int time) |
static String |
getAmPm(int time,
String am,
String pm) |
static int |
getIntegerFromString(String input) |
static Date |
parseDate(SimpleDateFormat sdf,
String string) |
static Date |
parseDate(String sdf,
String string) |
static Date |
parseDate(String input,
TimeZone tz) |
static String |
secondsToHour(int time) |
static String |
secondsToMinutes(int time) |
static String |
secondsToString(int time)
Converts time in seconds to a
String in the format h:mm. |
static String |
secondsToString(int time,
boolean withAmPm) |
static Date |
toDate(String date,
String time,
TimeZone tz)
Returns a Date object based on input date & time parameters Defaults to today / now (when
date / time are null)
|
static String |
trim(String str) |
public static Date toDate(String date, String time, TimeZone tz)
date
- time
- public static int getIntegerFromString(String input)
public static String secondsToString(int time)
String
in the format h:mm.time
- the time in seconds.String
representing the time in the format h:mmpublic static String secondsToString(int time, boolean withAmPm)
public static String secondsToHour(int time)
public static String secondsToMinutes(int time)
public static String getAmPm(int time)
public static String formatDate(String sdfFormat, Date date, String defValue, TimeZone tz)
public static Date parseDate(SimpleDateFormat sdf, String string)
public static long absoluteTimeout(double relativeTimeoutSeconds)
Copyright © 2019. All rights reserved.