Minutes (ParsiDateTime) - jalalvandi/ParsiDate GitHub Wiki

Method minute (on ParsiDateTime)

Returns the minute component of the time part of this ParsiDateTime.

Description

This method provides simple, read-only access to the minute-of-the-hour value stored within the ParsiDateTime instance.

The value returned will be an integer between 0 and 59 (inclusive).

Assumption: This method assumes the ParsiDateTime instance holds a valid minute number (0-59), as usually ensured by safe constructors.

Returns

  • An integer (u8 or similar type) representing the minute of the hour (0-59).

Examples (Rust)

use parsidate::ParsiDateTime; // Assuming use of a hypothetical ParsiDateTime struct

// Example 1: Getting the minute '30'
let dt = ParsiDateTime::new(1403, 5, 2, 15, 30, 45).unwrap();
assert_eq!(dt.minute(), 30);

// Example 2: Getting the minute '0' when time is exactly on the hour
let dt_on_the_hour = ParsiDateTime::new(1403, 5, 2, 16, 0, 0).unwrap();
assert_eq!(dt_on_the_hour.minute(), 0);

// Example 3: Getting minute '59'
// let dt_end_of_hour = ParsiDateTime::new(1403, 5, 2, 16, 59, 59).unwrap();
// assert_eq!(dt_end_of_hour.minute(), 59);