public class DateUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Date |
addDays(Date date,
int days)
Adds days to the given date. days can also be negative
|
static Date |
addMinutes(Date date,
int min)
Adds min minutes to the given date. min can also be negative.
|
static Date |
addMonths(Date date,
int months)
Adds months to the given date. months can also be negative
|
static Date |
addYears(Date date,
int years)
Adds year s to the given date. years can also be negative
|
static boolean |
dateAfter(Date after,
Date now)
Compare dates by their date portion
|
static boolean |
dateBefore(Date before,
Date now)
Compare dates by their date portion
|
static Date |
getDate(Date day,
Date hour) |
static Date |
getToday() |
static Date |
getToday(Date d) |
static Date |
getTodayHours(Date d) |
static Date |
getTodayMinutes() |
static Date |
getTodayMinutes(Date d) |
static String |
makeIsoTime(long time)
Convert unixTime to a ISO_OFFSET_DATE_TIME string like
required by the German Fiscal Security Element interface
|
static Date |
stripTime(Date date)
Strip the time portion off the date
|
public static boolean dateBefore(Date before, Date now)
before
- now
- public static boolean dateAfter(Date after, Date now)
before
- now
- public static Date stripTime(Date date)
date
- public static Date getToday()
public static Date getTodayMinutes()
public static Date addMinutes(Date date, int min)
date
- min
- The number of minutes to addpublic static Date addDays(Date date, int days)
date
- min
- The number of minutes to addpublic static Date addMonths(Date date, int months)
date
- months
- The number of months to addpublic static Date addYears(Date date, int years)
date
- years
- The number of months to addpublic static String makeIsoTime(long time)
time
- unix time in secondsCopyright © 2021. All rights reserved.