Obtains a JapaneseDate
from a temporal object.
Obtains a JapaneseDate
from a temporal object.
This obtains a date in the Japanese calendar system based on the specified temporal.
A TemporalAccessor
represents an arbitrary set of date and time information,
which this factory converts to an instance of JapaneseDate
.
The conversion typically uses the EPOCH_DAY
field, which is standardized across calendar systems.
This method matches the signature of the functional interface TemporalQuery
allowing it to be used as a query via method reference, JapaneseDate::from
.
the temporal object to convert, not null
the date in Japanese calendar system, not null
DateTimeException
if unable to convert to a { @code JapaneseDate}
Obtains the current JapaneseDate
from the specified clock.
Obtains the current JapaneseDate
from the specified clock.
This will query the specified clock to obtain the current date - today. Using this method allows the use of an alternate clock for testing. The alternate clock may be introduced using dependency injection.
the clock to use, not null
the current date, not null
DateTimeException
if the current date cannot be obtained
Obtains the current JapaneseDate
from the system clock in the specified time-zone.
Obtains the current JapaneseDate
from the system clock in the specified time-zone.
This will query the system clock
to obtain the current date.
Specifying the time-zone avoids dependence on the default time-zone.
Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.
the zone ID to use, not null
the current date using the system clock, not null
Obtains the current JapaneseDate
from the system clock in the default time-zone.
Obtains the current JapaneseDate
from the system clock in the default time-zone.
This will query the system clock
in the default
time-zone to obtain the current date.
Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.
the current date using the system clock and default time-zone, not null
Obtains a JapaneseDate
representing a date in the Japanese calendar
system from the proleptic-year, month-of-year and day-of-month fields.
Obtains a JapaneseDate
representing a date in the Japanese calendar
system from the proleptic-year, month-of-year and day-of-month fields.
This returns a JapaneseDate
with the specified fields.
The day must be valid for the year and month, otherwise an exception will be thrown.
The Japanese proleptic year, month and day-of-month are the same as those in the ISO calendar system. They are not reset when the era changes.
the Japanese proleptic-year
the Japanese month-of-year, from 1 to 12
the Japanese day-of-month, from 1 to 31
the date in Japanese calendar system, not null
DateTimeException
if the value of any field is out of range,
or if the day-of-month is invalid for the month-year
Obtains a JapaneseDate
representing a date in the Japanese calendar
system from the era, year-of-era, month-of-year and day-of-month fields.
Obtains a JapaneseDate
representing a date in the Japanese calendar
system from the era, year-of-era, month-of-year and day-of-month fields.
This returns a JapaneseDate
with the specified fields.
The day must be valid for the year and month, otherwise an exception will be thrown.
The Japanese month and day-of-month are the same as those in the ISO calendar system. They are not reset when the era changes. For example:
6th Jan Showa 64 = ISO 1989-01-06 7th Jan Showa 64 = ISO 1989-01-07 8th Jan Heisei 1 = ISO 1989-01-08 9th Jan Heisei 1 = ISO 1989-01-09
the Japanese era, not null
the Japanese year-of-era
the Japanese month-of-year, from 1 to 12
the Japanese day-of-month, from 1 to 31
the date in Japanese calendar system, not null
DateTimeException
if the value of any field is out of range,
or if the day-of-month is invalid for the month-year