TimeZone (ZonedParsiDateTime) - parsicore/parsidate GitHub Wiki

Method timezone (on ZonedParsiDateTime)

Returns a copy of the timezone associated with this ZonedParsiDateTime.

Description

This method retrieves the timezone in which the ZonedParsiDateTime instance exists.
The returned value represents the timezone context of the datetime and can be used for conversions or comparisons with other timezone-aware datetimes.

Arguments

This method does not take any arguments.

Returns

  • Tz: A copy of the timezone associated with this ZonedParsiDateTime instance.

Examples (Rust)

use parsidate::{ZonedParsiDateTime, Tz}; // Assuming these types exist

// Create a ZonedParsiDateTime for the current time in Tehran timezone
let zdt = ZonedParsiDateTime::now(Tehran);

// Retrieve the timezone
assert_eq!(zdt.timezone(), Tehran);