public class Timestamp
extends java.lang.Object
This timestamp class is a read only version supported by the ID3v2.4 specification. It is used in the following Id3v2.4 frame types:
FrameType.ENCODING_TIME
FrameType.ORIGINAL_RELEASE_TIME
FrameType.RECORDING_TIME
FrameType.RELEASE_TIME
FrameType.TAGGING_TIME
The timestamp fields are based on a subset of ISO 8601. When being as precise as possible the format of a time string is yyyy-MM-ddTHH:mm:ss (year, "-", month, "-", day, "T", hour (out of 24), ":", minutes, ":", seconds), but the precision may be reduced by removing as many time indicators as wanted. Hence, there are six valid timestamps:
Constructor and Description |
---|
Timestamp(int year)
constructor.
|
Timestamp(int year,
int month)
constructor.
|
Timestamp(int year,
int month,
int day)
constructor.
|
Timestamp(int year,
int month,
int day,
int hour)
constructor.
|
Timestamp(int year,
int month,
int day,
int hour,
int minute)
constructor.
|
Timestamp(int year,
int month,
int day,
int hour,
int minute,
int second)
constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString()
get a string representation of the time stamp.
|
public Timestamp(int year) throws java.lang.IllegalArgumentException
year
- four digit yearjava.lang.IllegalArgumentException
- if the year is less than or equal to 0.public Timestamp(int year, int month) throws java.lang.IllegalArgumentException
year
- four digit yearmonth
- two digit month (1-12)java.lang.IllegalArgumentException
- if the year is less than or equal to 0 or if the month is not in the range 1-12.public Timestamp(int year, int month, int day) throws java.lang.IllegalArgumentException
year
- four digit yearmonth
- two digit month (1-12)day
- two digit day (1-31)java.lang.IllegalArgumentException
- if the year is less than or equal to 0, the month is not in the range 1-12, or if the day is not in the range 1-31.public Timestamp(int year, int month, int day, int hour) throws java.lang.IllegalArgumentException
year
- four digit yearmonth
- two digit month (1-12)day
- two digit day (1-31)hour
- two digit hour (1-24)java.lang.IllegalArgumentException
- if the year is less than or equal to 0, the month is not in the range 1-12, the day is not in the range 1-31, or if the hour is not in the range 1-24.public Timestamp(int year, int month, int day, int hour, int minute) throws java.lang.IllegalArgumentException
year
- four digit yearmonth
- two digit month (1-12)day
- two digit day (1-31)hour
- two digit hour (1-24)minute
- two digit minute (1-59)java.lang.IllegalArgumentException
- if the year is less than or equal to 0, the month is not in the range 1-12, the day is not in the range 1-31, the hour is not in the range 1-24,
or if minute is not in the range 1 - 59.public Timestamp(int year, int month, int day, int hour, int minute, int second) throws java.lang.IllegalArgumentException
year
- four digit yearmonth
- two digit month (1-12)day
- two digit day (1-31)hour
- two digit hour (1-24)minute
- two digit minute (1-59)second
- two digit second (1-59)java.lang.IllegalArgumentException
- if the year is less than or equal to 0, the month is not in the range 1-12, the day is not in the range 1-31, the hour is not in the range 1-24,
the minute is not in the range 1 - 59, or if the second is not in the range 1 - 59.