DateTime (ZonedParsiDateTime) - parsicore/parsidate GitHub Wiki
Method datetime (on ZonedParsiDateTime)
Returns the naive ParsiDateTime (local datetime) component of this ZonedParsiDateTime.
Description
This method extracts the full date and time from the ZonedParsiDateTime, representing the local datetime in the object's timezone.
The returned ParsiDateTime does not contain any timezone information; it reflects the “wall clock” datetime as seen in the specified timezone.
Arguments
This method does not take any arguments.
Returns
ParsiDateTime: The full date and time component of theZonedParsiDateTimeas aParsiDateTimeinstance.
Examples (Rust)
use parsidate::{ZonedParsiDateTime, ParsiDateTime}; // Assuming these types exist
// Create a ZonedParsiDateTime for 1403-05-02 10:30:45 in Tehran timezone
let zdt = ZonedParsiDateTime::new(1403, 5, 2, 10, 30, 45, Tehran).unwrap();
// Extract the local datetime component
let expected_pdt = ParsiDateTime::new(1403, 5, 2, 10, 30, 45).unwrap();
assert_eq!(zdt.datetime(), expected_pdt);