public class TimeParts extends Object
Together with DefaultTimeScanner
, TimeParts implements a subset of
ISO 8601, the international standard for representing dates and times. Refer
to DefaultTimeScanner
for details.
Modifier and Type | Class and Description |
---|---|
static class |
TimeParts.HMSF
Immutable object encapsulating hours, minutes, seconds and fractional
seconds.
|
static class |
TimeParts.TimeZoneOffset
An immutable object representing a time zone offset.
|
static class |
TimeParts.YMD
Immutable object encapsulating years, months and days.
|
Constructor and Description |
---|
TimeParts(Resolution unit,
long year,
int month,
int day,
int hour,
int min,
int sec,
int fsec)
Constructor with a default time zone offset.
|
TimeParts(Resolution unit,
long year,
int month,
int day,
int hour,
int min,
int sec,
int fsec,
TimeParts.TimeZoneOffset tzOffset)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getDay()
Return the day.
|
int |
getFsec()
Return the fractional second.
|
int |
getFsec(Resolution targetUnit)
Return the fractional second with a given resolution.
|
int |
getHour()
Return the hour.
|
int |
getMin()
Return the minute.
|
int |
getMonth()
Return the month.
|
Resolution |
getResolution()
Return the time resolution.
|
int |
getSec()
Return the second.
|
TimeParts.TimeZoneOffset |
getTZOffset()
Return the time zone offset.
|
long |
getYear()
Return the year.
|
String |
toString() |
public TimeParts(Resolution unit, long year, int month, int day, int hour, int min, int sec, int fsec, TimeParts.TimeZoneOffset tzOffset)
unit
- a non-null time resolutionyear
- the yearmonth
- the monthday
- the dayhour
- the hourmin
- the minutesec
- the secondfsec
- the fractional second (millis, micros, etc. depending on the resolution)tzOffset
- the time zone offsetpublic TimeParts(Resolution unit, long year, int month, int day, int hour, int min, int sec, int fsec)
unit
- the time resolutionyear
- the yearmonth
- the monthday
- the dayhour
- the hourmin
- the minutesec
- the secondfsec
- the fractional secondpublic Resolution getResolution()
public long getYear()
public int getMonth()
public int getDay()
public int getHour()
public int getMin()
public int getSec()
public int getFsec()
public int getFsec(Resolution targetUnit)
targetUnit
- the resolution to convert topublic TimeParts.TimeZoneOffset getTZOffset()
Copyright © 2017. All rights reserved.