Java Utililty Methods TimeZone Usage

List of utility methods to do TimeZone Usage

Description

The list of methods to do TimeZone Usage are organized into topic(s).

Method

StringserializeTimeZone(TimeZone timeZone)
Serialize a TimeZone .
return timeZone.getID();
voidsetBelarusTimeZone()
set Belarus Time Zone
TimeZone.setDefault(TimeZone.getTimeZone(TIME_ZONE_BELARUS));
TimeZonestringToTimeZone(String tzString)
string To Time Zone
return TimeZone.getTimeZone(tzString != null ? tzString : "");
TimeZonetimeZone(String timeZoneEntry)
time Zone
TimeZone timeZone = TimeZone.getTimeZone(timeZoneEntry);
return timeZone;
TimeZonetimeZoneForCode(String timeZoneCode)
time Zone For Code
switch (timeZoneCode) {
case "E":
    return TimeZone.getTimeZone("US/Eastern");
case "C":
    return TimeZone.getTimeZone("US/Central");
case "M":
    return TimeZone.getTimeZone("US/Mountain");
case "P":
...
longtoDay(long millis)
to Day
return (millis + TimeZone.getDefault().getRawOffset()) / MILLIS_IN_DAY;
longtzOffsetToQ(final long dt)
tz Offset To Q
return dt - TIME_ZONE.getOffset(dt - TIME_ZONE.getOffset(dt));
voidvalidateTimeZone(String timeZoneID)
Check if the string id is a valid java TimeZone id.
if (TimeZone.getTimeZone(timeZoneID).getID().equals("GMT") && !"GMT".equals(timeZoneID)) {
    throw new IllegalStateException(
            "Unexpected timezone id found for parquet int96 conversion: " + timeZoneID);