public final class DateTimeUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static Calendar |
addDaysToCalendar(Calendar calendar,
int days) |
static Date |
addDaysToDate(Date date,
int days) |
static String |
format(Date date,
String pattern) |
static String |
formatWithDefaultPattern(Date date)
Format passing date with default
yyyy-MM-dd pattern. |
static Calendar |
getCalendar(Date date)
Gets the date as
Calendar. |
static Calendar |
getCurrentTimeCalendar() |
static Date |
getCurrentTimeDate() |
static long |
getCurrentTimeZoneOffset() |
static long |
getRelativeTime(Date date) |
static double |
getUtcMillisFromEpoch(Calendar calendar)
Gets the
Calendar as UTC milliseconds from the epoch. |
static boolean |
isInPast(Date date) |
static Date |
parse(String date,
String format) |
static Date |
parseWithDefaultPattern(String date)
Parses passing date with default
yyyy-MM-dd pattern. |
public static double getUtcMillisFromEpoch(Calendar calendar)
Calendar as UTC milliseconds from the epoch.calendar - the calendar to be converted to millispublic static Calendar getCurrentTimeCalendar()
public static Date getCurrentTimeDate()
public static boolean isInPast(Date date)
public static long getRelativeTime(Date date)
public static Date parseWithDefaultPattern(String date)
yyyy-MM-dd pattern.date - is date to be parsepublic static String formatWithDefaultPattern(Date date)
yyyy-MM-dd pattern.date - is date to be formatpublic static long getCurrentTimeZoneOffset()
Copyright © 1998–2021 iText Group NV. All rights reserved.