public class Times
extends java.lang.Object
| Modifier and Type | Method and Description | 
|---|---|
static java.text.DateFormat | 
createDateFormat(java.lang.String pattern)
Creates a format for rendering dates. 
 | 
static java.lang.String | 
formatUnixSeconds(long unixSec,
                 java.text.DateFormat format)
Formats an epoch in Unix seconds using a supplied date format. 
 | 
static java.lang.String | 
formatUnixSeconds(long unixSec,
                 java.lang.String fmt)
Formats an epoch in Unix seconds using a supplied date pattern. 
 | 
static double | 
isoToUnixSeconds(java.lang.String isoTime)
Decodes an ISO-8601 string to Unix seconds. 
 | 
static int | 
secToYear(long sec)
Converts unix seconds to year since 0AD. 
 | 
static long | 
yearToSec(int year)
Converts year since 0AD to unix seconds. 
 | 
public static double isoToUnixSeconds(java.lang.String isoTime)
isoTime - epoch specified in ISO-8601public static java.lang.String formatUnixSeconds(long unixSec,
                                                 java.text.DateFormat format)
unixSec - time in unix secondsformat - time formatpublic static java.lang.String formatUnixSeconds(long unixSec,
                                                 java.lang.String fmt)
unixSec - time in unix secondsfmt - time formatSimpleDateFormatpublic static java.text.DateFormat createDateFormat(java.lang.String pattern)
pattern - format patternSimpleDateFormatpublic static int secToYear(long sec)
sec - epoch in unix secondspublic static long yearToSec(int year)
year - year