public class NamedTimeZone
extends java.lang.Object
Constructor and Description |
---|
NamedTimeZone() |
Modifier and Type | Method and Description |
---|---|
static int |
civilTimeOffset(DateTimeValue date,
java.lang.String olsenName)
Get the civil time offset to be made to a given date/time in a given
civil timezone.
|
static java.lang.String |
formatTimeZoneOffset(DateTimeValue timeValue)
Format a timezone in numeric form for example +03:00 (or Z for +00:00)
|
static java.util.TimeZone |
getNamedTimeZone(java.lang.String olsonName)
Get the TimeZone object for a given Olson timezone name
|
static java.lang.String |
getOlsenTimeZoneName(DateTimeValue date,
java.lang.String country)
Try to identify a timezone name corresponding to a given date (including time zone)
and a given country.
|
static java.lang.String |
getTimeZoneNameForDate(DateTimeValue date,
java.lang.String place)
Try to identify a timezone name corresponding to a given date (including time zone)
and a given country.
|
static java.lang.Boolean |
inSummerTime(DateTimeValue date,
java.lang.String region)
Determine whether a given date/time is in summer time (daylight savings time)
in a given region.
|
public static java.lang.String getTimeZoneNameForDate(DateTimeValue date, java.lang.String place)
date
- the dateTimeValue, including timezoneplace
- either a two-letter ISO country code or an Olson timezone namepublic static java.lang.String formatTimeZoneOffset(DateTimeValue timeValue)
timeValue
- the value whose timezone is to be formattedpublic static java.lang.String getOlsenTimeZoneName(DateTimeValue date, java.lang.String country)
date
- the dateTimeValue, including timezonecountry
- the country, as a two-letter codepublic static java.lang.Boolean inSummerTime(DateTimeValue date, java.lang.String region)
date
- the date/time in questionregion
- either the two-letter ISO country code, or an Olsen timezone name such as
"America/New_York" or "Europe/Lisbon". If the country code denotes a country spanning several
timezones, such as the US, then one of them is chosen arbitrarily.public static int civilTimeOffset(DateTimeValue date, java.lang.String olsenName)
date
- the date/time in question. If this has no timezone, it is assumed
to be in GMT.olsenName
- the Olsen name of the timezone, for example Europe/Lisbonpublic static java.util.TimeZone getNamedTimeZone(java.lang.String olsonName)
olsonName
- an Olson timezone name, for example "Europe/London"Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.