Package org.pgpainless.util
Class DateUtil
- java.lang.Object
-
- org.pgpainless.util.DateUtil
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
formatUTCDate(Date date)
Format a date as UTC timestamp.static SimpleDateFormat
getParser()
static Date
now()
Return the current date "rounded" to UTC precision.static Date
parseUTCDate(String dateString)
Parse a UTC timestamp into a date.static Date
toSecondsPrecision(Date date)
"Round" a date down to seconds precision.
-
-
-
Method Detail
-
getParser
public static SimpleDateFormat getParser()
-
parseUTCDate
public static Date parseUTCDate(String dateString)
Parse a UTC timestamp into a date.- Parameters:
dateString
- timestamp- Returns:
- date
-
formatUTCDate
public static String formatUTCDate(Date date)
Format a date as UTC timestamp.- Parameters:
date
- date- Returns:
- timestamp
-
toSecondsPrecision
public static Date toSecondsPrecision(Date date)
"Round" a date down to seconds precision.- Parameters:
date
- date- Returns:
- rounded date
-
-