com.metsci.glimpse.util.units.time.format
Interface TimeStampFormat
- All Superinterfaces:
- java.lang.Cloneable
- All Known Implementing Classes:
- TimeStampFormatStandard
public interface TimeStampFormat
- extends java.lang.Cloneable
Field Summary |
static TimeStampFormat |
iso8601
The string must be a date-time string in ISO-8601 format, with the following
extra restrictions:
The string must include separators, even though ISO-8601 says
separators may be omitted in some cases. |
Method Summary |
java.lang.String |
format(java.math.BigDecimal posixSeconds)
|
java.math.BigDecimal |
parse(java.lang.String string)
|
iso8601
static final TimeStampFormat iso8601
- The string must be a date-time string in ISO-8601 format, with the following
extra restrictions:
- The string must include separators, even though ISO-8601 says
separators may be omitted in some cases.
- The string must include precision down to seconds, even though
ISO-8601 says precision may be truncated at any point.
- The string must end with a "Z", signifying the UTC timezone,
even though ISO-8601 says the "Z" is optional.
- The year must be exactly 4 digits, even though ISO-8601 says
the year may have more than 4 digits.
- "Week dates" (that is, week number 1-52) are not supported.
- "Ordinal dates" (that is, day of year 1-365) are not supported.
Examples:
- 2008-06-11T13:40:12Z
- 2008-06-11T13:40:12.5432931Z
parse
java.math.BigDecimal parse(java.lang.String string)
throws TimeStampParseException
- Returns:
- seconds since the epoch
- Throws:
TimeStampParseException
- if the string cannot be parsed according to this format
format
java.lang.String format(java.math.BigDecimal posixSeconds)
- Returns:
- a date-time string, formatted according to this format
Copyright © 2012 Metron, Inc.. All Rights Reserved.