pub struct Date { /* private fields */ }Expand description
Represents a date and time value used in PDF documents.
This struct stores time information with millisecond precision, following the PDF specification for date/time representation.
Implementations§
Source§impl Date
impl Date
Sourcepub fn new(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
time_zero: i8,
utm: u8,
) -> Self
pub fn new( year: i32, month: u8, day: u8, hour: u8, minute: u8, second: u8, time_zero: i8, utm: u8, ) -> Self
Creates a new Date instance with the specified date and time components.
§Arguments
year- The year (e.g., 2024)month- The month (1-12)day- The day of the month (1-31)hour- The hour (0-23)minute- The minute (0-59)second- The second (0-59)time_zero- Time zone offset from UTC in hours (-12 to +12)utm- shall be the absolute value of the offset from UT in minutes (00–59)
§Returns
A new Date instance with the calculated Unix timestamp in milliseconds
Sourcepub fn get_millisecond(&self) -> u64
pub fn get_millisecond(&self) -> u64
Returns the millisecond component of the date and time.
This represents the number of milliseconds elapsed since the Unix epoch (January 1, 1970, 00:00:00 UTC), adjusted for the time zone offset.
§Returns
The millisecond value as a u64.
Sourcepub fn get_time_zero(&self) -> i8
pub fn get_time_zero(&self) -> i8
Returns the time zone offset from UTC in hours.
This represents the time zone offset that was used when creating this
Date instance. The value is in the range of -12 to +12 hours.
§Returns
The time zone offset in hours as an i8.