Date (ZonedParsiDateTime) - parsicore/parsidate GitHub Wiki

Method date (on ZonedParsiDateTime)

Returns the naive ParsiDate (local date) component of this ZonedParsiDateTime.

Description

This method extracts the date part of the ZonedParsiDateTime, representing the local date in the object's timezone.

The returned ParsiDate does not contain any timezone information; it reflects the “wall clock” date as seen in the specified timezone.

Arguments

This method does not take any arguments.

Returns

  • ParsiDate: The date component of the ZonedParsiDateTime as a ParsiDate instance.

Examples (Rust)

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

// Create a ZonedParsiDateTime for 1403-05-02 10:00:00 in Tehran timezone
let zdt = ZonedParsiDateTime::new(1403, 5, 2, 10, 0, 0, Tehran).unwrap();

// Extract the date component
assert_eq!(zdt.date(), ParsiDate::new(1403, 5, 2).unwrap());