ZonedYearLocalizer

class ZonedYearLocalizer(options: ZonedYearOptions = ZonedYearOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotDateTimeZonedLocalizer<Int> (source)

Localizer for Zoned years (Zoned<Int>).

This behaves identically to YearLocalizer, but it also adds a TimeZone in the mix.

Because a year represents a big span of time, the timezone could have different offsets at different moments within the year. For this reason, only the TimeZoneStyle.Generic subset is allowed in the options for the time zone style.

Because kotlinx-datetime doesn't provide a standard type for a year, there is no extension function equivalent for one-off localizations.

Examples:

  • 2026, Los Angeles Time

  • 26 AD, PT

  • 2026 Anno Domini, Pacific Time

Constructors

Link copied to clipboard
constructor(options: ZonedYearOptions = ZonedYearOptions(), locale: PlatformLocale = getDefaultLocale())

Functions

Link copied to clipboard
open override fun localize(value: Zoned<Int>): String