Represents any time zone in the world.
Classes | |
| class | transition_time |
| Provides information about a specific time change, such as the change from daylight saving time to standard time or vice versa, in a particular time zone. More... | |
| class | adjustment_rule |
| Provides information about a time zone adjustment, such as the transition to and from daylight saving time. More... | |
Public Properties | |
| auto | base_utc_offset () const noexcept -> xtd::ticks |
| Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC). | |
| auto | daylight_name () const noexcept -> const xtd::string & |
| Gets the display name for the current time zone's daylight saving time. | |
| auto | display_name () const noexcept -> const xtd::string & |
| Gets the general display name that represents the time zone. | |
| auto | id () const noexcept -> const xtd::string & |
| Gets the time zone identifier. | |
| auto | standard_name () const noexcept -> const xtd::string & |
| Gets the display name for the time zone's standard time. | |
| auto | supports_daylight_saving_time () const noexcept -> bool |
| Gets a value indicating whether the time zone has any daylight saving time rules.*. | |
Public Methods | |
| auto | compare_to (const time_zone_info &tzi) const noexcept -> xtd::int32 override |
| Compares the current instance with another object of the same type. | |
| auto | equals (const xtd::object &obj) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | equals (const time_zone_info &tzi) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | get_adjustment_rules () const noexcept -> xtd::array< adjustment_rule > |
| Retrieves an array of xtd::time_zone_info::adjustment_rule objects that apply to the current xtd::time_zone_info object. | |
| auto | get_hash_code () const noexcept -> xtd::usize override |
| Serves as a hash function for a particular type. | |
| auto | is_daylight_saving_time (const xtd::date_time &date_time) const noexcept -> bool |
| Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current xtd::time_zone_info object. | |
| auto | to_string () const noexcept -> xtd::string override |
| Returns a xtd::string that represents the current object. | |
Public Static Properties | |
| static auto | local () noexcept -> const time_zone_info & |
| Gets a time_zone_info object that represents the local time zone. | |
| static auto | utc () noexcept -> const time_zone_info & |
| Gets a time_zone_info object that represents the Coordinated Universal Time (UTC) zone. | |
Public Static Methods | |
| static auto | convert_time_to_utc (const xtd::date_time &date_time) -> xtd::date_time |
| Converts the specified date and time to Coordinated Universal Time (UTC). | |
| static auto | get_system_time_zones () noexcept -> const xtd::collections::generic::list< time_zone_info > & |
| Returns a sorted collection of all the time zones about which information is available on the local system. | |
| static auto | convert_time (const xtd::date_time &date_time, const xtd::time_zone_info &destination_time_zone) -> xtd::date_time |
| Converts a time to the time in a particular time zone. | |
| static auto | convert_time (const xtd::date_time &date_time, const xtd::time_zone_info &source_time_zone, const xtd::time_zone_info &destination_time_zone) -> xtd::date_time |
| Converts a time from one time zone to another. | |
| static auto | convert_time_by_system_time_zone_id (const xtd::date_time &date_time, const xtd::string &destination_time_zone_id) -> xtd::date_time |
| Converts a time to the time in another time zone based on the time zone's identifier. | |
| static auto | convert_time_by_system_time_zone_id (const xtd::date_time &date_time, const xtd::string &source_time_zone_id, const xtd::string &destination_time_zone_id) -> xtd::date_time |
| Converts a time from one time zone to another based on time zone identifiers. | |
| static auto | convert_from_utc (const xtd::date_time &date_time, const xtd::time_zone_info &destination_time_zone) -> xtd::date_time |
| Converts a Coordinated Universal Time (UTC) to the time in a specified time zone. | |
| static auto | convert_to_utc (const xtd::date_time &date_time, const xtd::time_zone_info &source_time_zone) -> xtd::date_time |
| Converts the time in a specified time zone to Coordinated Universal Time (UTC). | |
| static auto | convert_to_utc (const xtd::date_time &date_time) -> xtd::date_time |
| Converts the specified date and time to Coordinated Universal Time (UTC). | |
| static auto | time_find_system_time_zone_by_id (const string &id) -> time_zone_info |
| Retrieves a time_zone_info object from the registry based on its identifier. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | get_type () const noexcept -> type_object |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| Creates a shallow copy of the current object. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are the same instance. | |
|
nodiscardnoexcept |
Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC).
|
nodiscardnoexcept |
Gets the display name for the current time zone's daylight saving time.
|
nodiscardnoexcept |
Gets the general display name that represents the time zone.
|
nodiscardnoexcept |
Gets the time zone identifier.
|
nodiscardnoexcept |
Gets the display name for the time zone's standard time.
|
nodiscardnoexcept |
Gets a value indicating whether the time zone has any daylight saving time rules.*.
|
staticnodiscardnoexcept |
Gets a time_zone_info object that represents the local time zone.
|
staticnodiscardnoexcept |
Gets a time_zone_info object that represents the Coordinated Universal Time (UTC) zone.
|
nodiscardoverridevirtualnoexcept |
Compares the current instance with another object of the same type.
| obj | An object to compare with this instance. |
| Value | Condition |
|---|---|
| Less than zero | This instance is less than obj. |
| Zero | This instance is equal to obj. |
| Greater than zero | This instance is greater than obj. |
Implements xtd::icomparable< time_zone_info >.
|
nodiscardoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
Reimplemented from xtd::object.
|
nodiscardoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| tzi | The object to compare with the current object. |
Implements xtd::iequatable< time_zone_info >.
|
nodiscardnoexcept |
Retrieves an array of xtd::time_zone_info::adjustment_rule objects that apply to the current xtd::time_zone_info object.
|
nodiscardoverridevirtualnoexcept |
Serves as a hash function for a particular type.
Reimplemented from xtd::object.
|
nodiscardnoexcept |
Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current xtd::time_zone_info object.
| date_time | A date and time value. |
|
nodiscardoverridevirtualnoexcept |
Returns a xtd::string that represents the current object.
Reimplemented from xtd::object.
|
staticnodiscard |
Converts the specified date and time to Coordinated Universal Time (UTC).
| dateTime | The date and time to convert. |
| xtd::argument_exception | time_zone_info::Local().IsInvalidxtd::date_time(dateTime) returns `true`. |
|
staticnodiscardnoexcept |
Returns a sorted collection of all the time zones about which information is available on the local system.
|
staticnodiscard |
Converts a time to the time in a particular time zone.
| date_time | The date and time to convert. |
| destination_time_zone | The time zone to convert dateTime to. |
| xtd::argument_exception | The value of the date_time parameter represents an invalid time. |
|
staticnodiscard |
Converts a time from one time zone to another.
| date_time | The date and time to convert. |
| source_time_zone | The time zone of date_time. |
| destination_time_zone | The time zone to convert date_time to. |
| xtd::argument_exception | The xtd::date_time::kind property of the date_time parameter is xtd::date_time_kind::local, but the source_time_tone parameter does not equal xtd::date_time_kind::local. -or- The xtd::date_time::kind property of the date_time parameter is xtd::date_time_kind::utc, but the source_time_zone parameter does not equal xtd::date_time_kind::utc. -or- The date_time parameter is an invalid time (that is, it represents a time that does not exist because of a time zone's adjustment rules). |
|
staticnodiscard |
Converts a time to the time in another time zone based on the time zone's identifier.
| date_time | The date and time to convert. |
| destination_time_zone_id | The identifier of the destination time zone. |
|
staticnodiscard |
Converts a time from one time zone to another based on time zone identifiers.
| date_time | The date and time to convert. |
| source_time_zone_id | The identifier of the source time zone. |
| destintion_time_zone_id | The identifier of the destination time zone. |
|
staticnodiscard |
Converts a Coordinated Universal Time (UTC) to the time in a specified time zone.
| date_time | The Coordinated Universal Time (UTC). |
| destination_time_zone | The time zone to convert dateTime to. |
|
staticnodiscard |
Converts the time in a specified time zone to Coordinated Universal Time (UTC).
| date_time | The date and time to convert. |
| source_time_zone | The time zone of dateTime. |
|
staticnodiscard |
Converts the specified date and time to Coordinated Universal Time (UTC).
| date_time | The date and time to convert. |
|
staticnodiscard |
Retrieves a time_zone_info object from the registry based on its identifier.
| id | The time zone identifier, which corresponds to the Id property. |
| xtd::time_zone_not_found_exception | The time zone identifier specified by id was not found. This means that a registry key whose name matches id does not exist, or that the key exists but does not contain any time zone data. |