public class DateUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static SimpleDateFormat |
dateFormat |
| Constructor and Description |
|---|
DateUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Date |
addDay(Date date,
int addDays) |
static Date |
addMinutes(Date date,
int minutes) |
static Date |
addSeconds(Date date,
int seconds) |
static long |
dateToTimestamp(Date date) |
static String |
formatDefaultString(Date date) |
static String |
getCurrentFormatDate()
Get the current format time
|
static long |
getCurrentTimestamp()
Get current date timestamp(millisecond)
|
static long |
getCurrentTimestamps()
Get current date timestamp(second)
|
static Date |
getDateFromGmt(String timeZone) |
static long |
getDiffMinute(Date date)
Get the time difference from the current time (unit: minutes)
|
static long |
offsetNextDaySecond(Date date)
method description Seconds remaining until the transit of the next day
|
static Date |
stringToDate(String dateStr)
String to Date
|
static Date |
timestampToDate(long timestamp) |
static String |
timestampToDateString(long timestamp) |
public static SimpleDateFormat dateFormat
public static String timestampToDateString(long timestamp)
public static Date timestampToDate(long timestamp)
public static long offsetNextDaySecond(Date date)
date - public static long getCurrentTimestamp()
public static long getCurrentTimestamps()
public static long dateToTimestamp(Date date)
public static Date stringToDate(String dateStr)
dateStr - public static long getDiffMinute(Date date)
date - public static String getCurrentFormatDate()
Copyright © 2023. All rights reserved.