#[repr(C)]pub struct QDate { /* private fields */ }
Expand description
The QDate class provides date functions.
Implementations§
Source§impl QDate
impl QDate
Sourcepub fn add_months(&self, nmonths: i32) -> QDate
pub fn add_months(&self, nmonths: i32) -> QDate
Returns a QDate object containing a date nmonths later than the date of this object (or earlier if nmonths is negative).
Source§impl QDate
impl QDate
Sourcepub fn day_of_week(&self) -> i32
pub fn day_of_week(&self) -> i32
Returns the weekday (1 = Monday to 7 = Sunday) for this date.
Source§impl QDate
impl QDate
Sourcepub fn day_of_year(&self) -> i32
pub fn day_of_year(&self) -> i32
Returns the day of the year (1 for the first day) for this date.
Source§impl QDate
impl QDate
Sourcepub fn days_in_monyth(&self) -> i32
pub fn days_in_monyth(&self) -> i32
Returns the number of days in the month for this date.
Source§impl QDate
impl QDate
Sourcepub fn days_in_year(&self) -> i32
pub fn days_in_year(&self) -> i32
Returns the number of days in the year for this date.
Source§impl QDate
impl QDate
Sourcepub fn format_enum(&self, format: DateFormat) -> QString
pub fn format_enum(&self, format: DateFormat) -> QString
Returns the time as a string. The format parameter determines the format of the string.
Source§impl QDate
impl QDate
Sourcepub fn add_days(&self, ndays: i64) -> Self
pub fn add_days(&self, ndays: i64) -> Self
Returns a QDate object containing a date ndays later than the date of this object (or earlier if ndays is negative).
Returns a null date if the current date is invalid or the new date is out of range.
pub fn current_date() -> Self
Sourcepub fn days_to(&self, date: Self) -> i64
pub fn days_to(&self, date: Self) -> i64
Returns the number of days from this date to d (which is negative if d is earlier than this date).
Returns 0 if either date is invalid.
Sourcepub fn format(&self, format: &QString) -> QString
pub fn format(&self, format: &QString) -> QString
Returns the time as a string. The format parameter determines the format of the result string.
Sourcepub fn from_julian_day(jd: i64) -> Self
pub fn from_julian_day(jd: i64) -> Self
Converts the Julian day jd to a QDate.
Sourcepub fn from_string(string: &QString, format: &QString) -> Option<Self>
pub fn from_string(string: &QString, format: &QString) -> Option<Self>
Returns the QTime represented by the string, using the format given, or None if the string cannot be parsed.
Sourcepub fn from_string_enum(string: &QString, format: DateFormat) -> Option<Self>
pub fn from_string_enum(string: &QString, format: DateFormat) -> Option<Self>
Returns the time represented in the string as a QTime using the format given, or None if this is not possible.
Sourcepub fn is_leap_year(year: i32) -> bool
pub fn is_leap_year(year: i32) -> bool
Returns true if the specified year is a leap year in the Gregorian calendar; otherwise returns false.
Sourcepub fn to_julian_day(&self) -> i64
pub fn to_julian_day(&self) -> i64
Converts the date to a Julian day.