Struct cxx_qt_lib::QDate
source · #[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.
Trait Implementations§
source§impl ExternType for QDate
impl ExternType for QDate
source§impl Ord for QDate
impl Ord for QDate
source§impl PartialEq for QDate
impl PartialEq for QDate
source§impl PartialOrd for QDate
impl PartialOrd for QDate
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more