Package sop.util

# Class UTCUtil

java.lang.Object
sop.util.UTCUtil

public class UTCUtil extends Object
Utility class to parse and format dates as ISO-8601 UTC timestamps.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final SimpleDateFormat`
`UTC_FORMATTER`
`static final SimpleDateFormat[]`
`UTC_PARSERS`

## Constructor Summary

Constructors
Constructor
Description
`UTCUtil()`

## Method Summary

Modifier and Type
Method
Description
`static String`
`formatUTCDate(Date date)`
Format a date as ISO-8601 UTC timestamp.
`static Date`
`parseUTCDate(String dateString)`
Parse an ISO-8601 UTC timestamp from a string.

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

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

## Field Details

### UTC_FORMATTER

public static final SimpleDateFormat UTC_FORMATTER

### UTC_PARSERS

public static final SimpleDateFormat[] UTC_PARSERS

## Constructor Details

### UTCUtil

public UTCUtil()

## Method Details

### parseUTCDate

@Nonnull public static Date parseUTCDate(String dateString) throws ParseException
Parse an ISO-8601 UTC timestamp from a string.

Parameters:
  `dateString` - string
Returns:
  date
Throws:
  `ParseException` - if the date string is malformed and cannot be parsed

### formatUTCDate

public static String formatUTCDate(Date date)
Format a date as ISO-8601 UTC timestamp.

Parameters:
  `date` - date
Returns:
  timestamp string