Class BrokenDownTime
Strftime formats, held the way C holds them so that the arithmetic ported from
glibc applies unchanged.
Two conventions come from struct tm rather than java.time: dayOfYear()
counts from zero (tm_yday) and dayOfWeek() counts from Sunday (tm_wday).
Every week-number formula in glibc is written against those, so converting them here keeps
Strftime a transcription rather than a reinterpretation.
Unlike a real struct tm, the three fields a calendar does not hand over for free —
the day of the year, the day of the week and the epoch second — are derived on first use, since
a pattern such as "%Y-%m-%d" asks for none of them.
Instances are mutable and meant to be filled once per format call. year is proleptic,
not the tm_year offset from 1900.
Based on glibc:
__strftime_internal,
which reads all of its input from a struct tm plus tm_gmtoff and the zone name.
-
Method Summary
Modifier and TypeMethodDescriptionvoidFills the fields from an instant read inzone, without building aZonedDateTimeunless one is later asked for.voidFills the fields from the start ofvalueinzone.voidset(LocalDateTime value, ZoneId zone) Fills the fields from a wall-clock reading interpreted inzone.voidset(OffsetDateTime value) Fills the fields from an offset date-time, keeping its own offset rather than moving it to another zone.voidset(ZonedDateTime value) Fills the fields from a zoned date-time, which already carries everything needed.voidFills the fields from aCalendarinstant read inzone.voidFills the fields from a legacyDateread inzone.
-
Method Details
-
set
Fills the fields from a zoned date-time, which already carries everything needed. -
set
Fills the fields from an instant read inzone, without building aZonedDateTimeunless one is later asked for. -
set
Fills the fields from an offset date-time, keeping its own offset rather than moving it to another zone. -
set
Fills the fields from a legacyDateread inzone. -
set
Fills the fields from aCalendarinstant read inzone. -
set
Fills the fields from a wall-clock reading interpreted inzone. A reading that falls in a daylight-saving gap is moved forward byLocalDateTime.atZone(ZoneId), as elsewhere in this library. -
set
Fills the fields from the start ofvalueinzone.
-