public class

DateUtils

extends Object
java.lang.Object
   ↳ com.urbanairship.util.DateUtils

Class Overview

Date utilities.

Summary

Public Methods
static String createIso8601TimeStamp(long milliseconds)
Creates an ISO 8601 formatted time stamp.
static long parseIso8601(String timeStamp, long defaultValue)
Parses an ISO 8601 timestamp.
static long parseIso8601(String timeStamp)
Parses an ISO 8601 timestamp.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static String createIso8601TimeStamp (long milliseconds)

Creates an ISO 8601 formatted time stamp.

Parameters
milliseconds The time in milliseconds since Jan. 1, 1970, midnight GMT.
Returns
  • An ISO 8601 formatted time stamp.

public static long parseIso8601 (String timeStamp, long defaultValue)

Parses an ISO 8601 timestamp.

Parameters
timeStamp The ISO time stamp string.
defaultValue The default value
Returns
  • The time in milliseconds since Jan. 1, 1970, midnight GMT or the default value if the timestamp was unable to be parsed.

public static long parseIso8601 (String timeStamp)

Parses an ISO 8601 timestamp.

Parameters
timeStamp The ISO time stamp string.
Returns
  • The time in milliseconds since Jan. 1, 1970, midnight GMT or -1 if the timestamp was unable to be parsed.
Throws
ParseException if the timestamp was unable to be parsed.