public interface TimeStamp
Specifies a date and time in UTC (Coordinated Universal Time). The value is made up of a date and time structures.
For more information on UTC, see the entry on Coordinated Universal Time on Wikipedia.
To make values of this type, use the following methods from the MAJ forge:
Forge.makeTimeStamp(DateStruct, TimeStruct) and
Forge.makeTimeStamp(short, byte, byte, byte, byte, byte, byte);Calendar value:
Forge.makeTimeStamp(java.util.Calendar);Forge.now();toString():
Forge.parseTimeStamp(String).TimeStruct,
DateStruct,
TypeDefinitions.TimeStamp| Modifier and Type | Method and Description |
|---|---|
TimeStamp |
clone()
Create a cloned copy of this time stamp.
|
DateStruct |
getDate()
Returns the date component of the time stamp.
|
TimeStruct |
getTime()
Returns the time component of the time stamp.
|
Calendar |
getTimeStamp()
Returns a calendar value representing this time stamp.
|
void |
setDate(DateStruct date)
Sets the date component of the time stamp.
|
void |
setStamp(DateStruct date,
TimeStruct time)
Simultaneously sets the date and time components of the time stamp.
|
void |
setTime(TimeStruct time)
Sets the time component of the time stamp.
|
String |
toString()
Formats the time stamp as a string according ISO 8601 and as a UTC value.
|
void setStamp(DateStruct date, TimeStruct time) throws NullPointerException, IllegalArgumentException
Simultaneously sets the date and time components of the time stamp.
date - Date component of the time stamp.time - Time component of the time stamp.NullPointerException - One or both of the given data or time structures are null.IllegalArgumentException - One or both of the given date or time values are not valid.DateStruct getDate()
Returns the date component of the time stamp.
void setDate(DateStruct date) throws NullPointerException, IllegalArgumentException
Sets the date component of the time stamp.
date - Date component of the time stamp.NullPointerException - The given data structure is null.IllegalArgumentException - The given date is not valid.TimeStruct getTime()
Returns the time component of the time stamp.
void setTime(TimeStruct time) throws NullPointerException, IllegalArgumentException
Sets the time component of the time stamp.
time - Time component of the time stamp.NullPointerException - The given time structure is null.IllegalArgumentException - The given time is not valid.TimeStamp clone()
Create a cloned copy of this time stamp.
String toString()
Formats the time stamp as a string according ISO 8601 and as a UTC value.
The format of the string is "yyyy-MM-dd'T'HH:mm:ss.SSZ", where:
The representation of a time stamp generated by this method can be converted back to
a time stamp value using Forge.parseTimeStamp(String).
toString in class ObjectForge.parseTimeStamp(String),
SimpleDateFormatCalendar getTimeStamp()
Returns a calendar value representing this time stamp. The method returns a copy of internal calendar value to preserve the internal state of this value.
Forge.makeTimeStamp(Calendar)(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.