public class Times extends Object
Modifier and Type | Method and Description |
---|---|
static DateFormat |
createDateFormat(String pattern)
Creates a format for rendering dates.
|
static String |
formatUnixSeconds(long unixSec,
DateFormat format)
Formats an epoch in Unix seconds using a supplied date format.
|
static String |
formatUnixSeconds(long unixSec,
String fmt)
Formats an epoch in Unix seconds using a supplied date pattern.
|
static double |
isoToUnixSeconds(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(String isoTime)
isoTime
- epoch specified in ISO-8601public static String formatUnixSeconds(long unixSec, DateFormat format)
unixSec
- time in unix secondsformat
- time formatpublic static String formatUnixSeconds(long unixSec, String fmt)
unixSec
- time in unix secondsfmt
- time formatSimpleDateFormat
public static DateFormat createDateFormat(String pattern)
pattern
- format patternSimpleDateFormat
public static int secToYear(long sec)
sec
- epoch in unix secondspublic static long yearToSec(int year)
year
- yearCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.