ZoneId

The ZoneId function returns the timezone id for the given input parameter.

Syntax

 ZoneId(<date>|<date_time>|<instant>|<offset_date_time>|<zoned_date_time>)

Return Type

String

Details

xSQL supports several date and time related data types, some of which store timezone offset and name information. Use ZoneName to return the abbreviated timezone display name.

Data type
Timezone information available
Data type
Timezone information available
date No timezone information is stored. Defaults values to Pacific timezone.
date_time No timezone information is stored. Defaults values to Pacific timezone.
instant All values stored in UTC/Zulu time.
offset_date_time Stores UTC offset values. Refer to Java 8 docs for more information: https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html
zoned_date_time Stores UTC offset and timezone values. Refer to Java 8 docs for more information: https://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html

 

Examples

select date1,
zoned_date_time_europe1,
ZoneId(date1) as date_zone_example,
ZoneId(date_time1) as date_time_example,
ZoneId(offset_date_time1) as offset_date_time_example,
ZoneId(zoned_date_time_europe1) as zoned_date_time_example
from AllTypes();

screen-shot-2016-10-19-at-11-02-21-am

Related Functions

FormatDateTime

ToDate

ToDateTime

ToOffsetDateTime

ToZonedDateTime

ZoneName