Learn R Programming

phinterval (version 1.0.0)

is_recognized_tzone: Test if the object is a recognized time zone

Description

is_recognized_tzone() returns TRUE for strings that are recognized IANA time zone names, and FALSE otherwise.

Usage

is_recognized_tzone(x)

Value

TRUE if x is a recognized time zone, FALSE otherwise.

Arguments

x

An object to test.

Details

Recognized time zones are those listed in tzdb::tzdb_names(), which provides an up-to-date copy of time zones from the IANA time zone database.

<phinterval> vectors with an unrecognized time zone are formatted using the "UTC" time zone with a warning.

Examples

Run this code
is_recognized_tzone("UTC")
is_recognized_tzone("America/New_York")
is_recognized_tzone("")
is_recognized_tzone("badzone")
is_recognized_tzone(10L)

Run the code above in your browser using DataLab