Package org.pgpainless.util

# Class DateUtil

java.lang.Object
org.pgpainless.util.DateUtil

public final class DateUtil extends Object

## Method Summary

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 "floored" to UTC precision.
`static Date`
`parseUTCDate(String dateString)`
Parse a UTC timestamp into a date.
`static Date`
`toSecondsPrecision(Date date)`
Floor a date down to seconds precision.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### getParser

@Nonnull public static SimpleDateFormat getParser()

### parseUTCDate

@Nonnull public static Date parseUTCDate(@Nonnull String dateString)
Parse a UTC timestamp into a date.

Parameters:
  `dateString` - timestamp
Returns:
  date

### formatUTCDate

@Nonnull public static String formatUTCDate(Date date)
Format a date as UTC timestamp.

Parameters:
  `date` - date
Returns:
  timestamp

### toSecondsPrecision

@Nonnull public static Date toSecondsPrecision(@Nonnull Date date)
Floor a date down to seconds precision.

Parameters:
  `date` - date
Returns:
  floored date

### now

@Nonnull public static Date now()
Return the current date "floored" to UTC precision.

Returns:
  now