#[repr(C)]pub struct NSDate {
pub ptr: Id<Object>,
}
Expand description
A representation of a specific point in time, independent of any calendar or time zone.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl NSDate
impl NSDate
Sourcepub fn date_with_time_interval_since_now(time_interval: NSTimeInterval) -> Self
pub fn date_with_time_interval_since_now(time_interval: NSTimeInterval) -> Self
Creates and returns a date object set to a given number of seconds from the current date and time.
Sourcepub fn date_with_time_interval_since_date(
secs_to_be_added: NSTimeInterval,
date: NSDate,
) -> Self
pub fn date_with_time_interval_since_date( secs_to_be_added: NSTimeInterval, date: NSDate, ) -> Self
Creates and returns a date object set to a given number of seconds from the specified date.
Sourcepub fn date_with_time_interval_since_reference_date(
secs_to_be_added: NSTimeInterval,
) -> Self
pub fn date_with_time_interval_since_reference_date( secs_to_be_added: NSTimeInterval, ) -> Self
Creates and returns a date object set to a given number of seconds from 00:00:00 UTC on 1 January 2001.
Sourcepub fn date_with_time_interval_since1970(
secs_to_be_added: NSTimeInterval,
) -> Self
pub fn date_with_time_interval_since1970( secs_to_be_added: NSTimeInterval, ) -> Self
Creates and returns a date object set to the given number of seconds from 00:00:00 UTC on 1 January 1970.
Sourcepub fn distant_future() -> NSDate
pub fn distant_future() -> NSDate
A date object representing a date in the distant future.
Sourcepub fn distant_past() -> NSDate
pub fn distant_past() -> NSDate
A date object representing a date in the distant past.
Sourcepub fn is_equal_to_date(&self, date: NSDate) -> bool
pub fn is_equal_to_date(&self, date: NSDate) -> bool
Returns a Boolean value that indicates whether a given object is a date that is exactly equal the receiver.
Sourcepub fn earlier_date(&self, date: NSDate) -> Self
pub fn earlier_date(&self, date: NSDate) -> Self
Returns the earlier of the receiver and another given date.
Sourcepub fn later_date(&self, date: NSDate) -> Self
pub fn later_date(&self, date: NSDate) -> Self
Returns the later of the receiver and another given date.
Sourcepub fn compare(&self, date: NSDate) -> NSComparisonResult
pub fn compare(&self, date: NSDate) -> NSComparisonResult
Indicates the temporal ordering of the receiver and another given date.
Sourcepub fn time_interval_since_date(&self, date: NSDate) -> NSTimeInterval
pub fn time_interval_since_date(&self, date: NSDate) -> NSTimeInterval
Returns the interval between the receiver and another given date.
Sourcepub fn time_interval_since_now(&self) -> NSTimeInterval
pub fn time_interval_since_now(&self) -> NSTimeInterval
The interval between the date object and the current date and time.
Sourcepub fn time_interval_since_reference_date() -> NSTimeInterval
pub fn time_interval_since_reference_date() -> NSTimeInterval
The interval between the date object and 00:00:00 UTC on 1 January 2001.
Sourcepub fn time_interval_since_1970() -> NSTimeInterval
pub fn time_interval_since_1970() -> NSTimeInterval
The interval between the date object and 00:00:00 UTC on 1 January 1970.
Sourcepub fn date_by_adding_time_interval(
&self,
secs_to_be_added: NSTimeInterval,
) -> Self
pub fn date_by_adding_time_interval( &self, secs_to_be_added: NSTimeInterval, ) -> Self
Returns a new date object that is set to a given number of seconds relative to the receiver.
Methods from Deref<Target = Object>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.