Struct cxx_qt_lib::QDateTime

source ·
#[repr(C)]
pub struct QDateTime { /* private fields */ }
Expand description

The QDateTime class provides date and time functions.

Implementations§

source§

impl QDateTime

source

pub fn add_months(&self, nmonths: i32) -> QDateTime

Returns a QDateTime object containing a datetime nmonths months later than the datetime of this object (or earlier if nmonths is negative).

source§

impl QDateTime

source

pub fn add_years(&self, nyears: i32) -> QDateTime

Returns a QDateTime object containing a datetime nyears years later than the datetime of this object (or earlier if nyears is negative).

source§

impl QDateTime

source

pub fn date(&self) -> QDate

Returns the date part of the datetime.

source§

impl QDateTime

source

pub fn is_daylight_time(&self) -> bool

Returns if this datetime falls in Daylight-Saving Time.

source§

impl QDateTime

source

pub fn is_null(&self) -> bool

Returns true if both the date and the time are null; otherwise returns false. A null datetime is invalid.

source§

impl QDateTime

source

pub fn is_valid(&self) -> bool

Returns true if both the date and the time are valid and they are valid in the current Qt::TimeSpec, otherwise returns false.

source§

impl QDateTime

source

pub fn offset_from_utc(&self) -> i32

Returns this date-time’s Offset From UTC in seconds.

source§

impl QDateTime

source

pub fn set_offset_from_utc(&mut self, offset_seconds: i32)

Sets the timeSpec() to Qt::OffsetFromUTC and the offset to offsetSeconds.

source§

impl QDateTime

source

pub fn set_time_spec(&mut self, spec: TimeSpec)

Sets the time specification used in this datetime to spec. The datetime will refer to a different point in time.

source§

impl QDateTime

source

pub fn time(&self) -> QTime

Returns the time part of the datetime.

source§

impl QDateTime

source

pub fn time_spec(&self) -> TimeSpec

Returns the time specification of the datetime.

source§

impl QDateTime

source

pub fn time_zone_abbreviation(&self) -> QString

Returns the Time Zone Abbreviation for this datetime.

source§

impl QDateTime

source

pub fn to_local_time(&self) -> QDateTime

Returns a datetime containing the date and time information in this datetime, but specified using the Qt::LocalTime definition.

source§

impl QDateTime

source

pub fn to_offset_from_utc(&self, offset_seconds: i32) -> QDateTime

Returns a copy of this datetime converted to a spec of Qt::OffsetFromUTC with the given offsetSeconds.

source§

impl QDateTime

source

pub fn to_time_spec(&self, spec: TimeSpec) -> QDateTime

Returns a copy of this datetime converted to the given time spec.

source§

impl QDateTime

source

pub fn to_time_zone(&self, timeZone: &QTimeZone) -> QDateTime

Returns a copy of this datetime converted to the given timeZone

source§

impl QDateTime

source

pub fn to_utc(&self) -> QDateTime

Returns a datetime containing the date and time information in this datetime, but specified using the Qt::UTC definition.

source§

impl QDateTime

source

pub fn set_time_zone(&mut self, time_zone: &QTimeZone)

Sets the time zone used in this datetime to toZone. The datetime will refer to a different point in time.

source

pub fn add_days(&self, ndays: i64) -> Self

Returns a QDateTime object containing a datetime ndays days later than the datetime of this object (or earlier if ndays is negative).

source

pub fn add_msecs(&self, msecs: i64) -> Self

Returns a QDateTime object containing a datetime msecs milliseconds later than the datetime of this object (or earlier if msecs is negative).

source

pub fn add_secs(&self, secs: i64) -> Self

Returns a QDateTime object containing a datetime s seconds later than the datetime of this object (or earlier if s is negative).

source

pub fn current_date_time() -> Self

Returns the current datetime, as reported by the system clock, in the local time zone.

source

pub fn current_date_time_utc() -> Self

Returns the current datetime, as reported by the system clock, in UTC.

source

pub fn current_msecs_since_epoch() -> i64

Returns the number of milliseconds since 1970-01-01T00:00:00 Universal Coordinated Time. This number is like the POSIX time_t variable, but expressed in milliseconds instead.

source

pub fn current_secs_since_epoch() -> i64

Returns the number of seconds since 1970-01-01T00:00:00 Universal Coordinated Time.

source

pub fn days_to(&self, other: &Self) -> i64

Returns the number of days from this datetime to the other datetime. The number of days is counted as the number of times midnight is reached between this datetime to the other datetime. This means that a 10 minute difference from 23:55 to 0:05 the next day counts as one day.

source

pub fn from_date_and_time_time_zone( date: &QDate, time: &QTime, time_zone: &QTimeZone ) -> Self

Construct a Rust QDateTime from a given QDate, QTime, and QTimeZone

source

pub fn from_date_and_time_time_spec( date: &QDate, time: &QTime, time_spec: TimeSpec, offset_seconds: i32 ) -> Self

Construct a Rust QDateTime from a given QDate, QTime, Qt::TimeSpec, and offset

source

pub fn from_msecs_since_epoch(msecs: i64, time_zone: &QTimeZone) -> Self

Returns a datetime whose date and time are the number of milliseconds msecs that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (Qt::UTC) and with the given timeZone.

source

pub fn from_secs_since_epoch(secs: i64, time_zone: &QTimeZone) -> Self

Returns a datetime whose date and time are the number of seconds secs that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (Qt::UTC) and converted to the given spec.

source

pub fn msecs_to(&self, other: &Self) -> i64

Returns the number of milliseconds from this datetime to the other datetime. If the other datetime is earlier than this datetime, the value returned is negative.

source

pub fn secs_to(&self, other: &Self) -> i64

Returns the number of seconds from this datetime to the other datetime. If the other datetime is earlier than this datetime, the value returned is negative.

source

pub fn set_date(&mut self, date: QDate)

Sets the date part of this datetime to date. If no time is set yet, it is set to midnight. If date is invalid, this QDateTime becomes invalid.

source

pub fn set_msecs_since_epoch(&mut self, msecs: i64)

Sets the date and time given the number of milliseconds msecs that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (Qt::UTC). On systems that do not support time zones this function will behave as if local time were Qt::UTC.

source

pub fn set_secs_since_epoch(&mut self, secs: i64)

Sets the date and time given the number of seconds secs that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (Qt::UTC). On systems that do not support time zones this function will behave as if local time were Qt::UTC.

source

pub fn set_time(&mut self, time: QTime)

Sets the time part of this datetime to time. If time is not valid, this function sets it to midnight. Therefore, it’s possible to clear any set time in a QDateTime by setting it to a default QTime.

source

pub fn time_zone(&self) -> UniquePtr<QTimeZone>

Returns the time zone of the datetime.

source

pub fn to_msecs_since_epoch(&self) -> i64

Returns the datetime as the number of milliseconds that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (Qt::UTC).

source

pub fn to_secs_since_epoch(&self) -> i64

Returns the datetime as the number of seconds that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (Qt::UTC).

Trait Implementations§

source§

impl Clone for QDateTime

source§

fn clone(&self) -> Self

Constructs a copy of the other datetime.

1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QDateTime

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for QDateTime

source§

fn default() -> Self

Construct a default null QDateTime

source§

impl Display for QDateTime

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for QDateTime

source§

fn drop(&mut self)

Destroys the datetime.

source§

impl ExternType for QDateTime

§

type Id = (Q, D, a, t, e, T, i, m, e)

A type-level representation of the type’s C++ namespace and type name. Read more
§

type Kind = Trivial

source§

impl Ord for QDateTime

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for QDateTime

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for QDateTime

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl QListElement for QDateTime

§

type TypeId = (Q, L, i, s, t, __, Q, D, a, t, e, T, i, m, e)

source§

fn append(list: &mut QList<Self>, value: Self)

source§

fn append_clone(list: &mut QList<Self>, value: &Self)

source§

fn clear(list: &mut QList<Self>)

source§

fn clone(list: &QList<Self>) -> QList<Self>

source§

fn contains(list: &QList<Self>, value: &Self) -> bool

source§

fn default() -> QList<Self>

source§

fn drop(list: &mut QList<Self>)

source§

unsafe fn get_unchecked(list: &QList<Self>, pos: isize) -> &Self

Safety Read more
source§

fn index_of(list: &QList<Self>, value: &Self) -> isize

source§

fn insert(list: &mut QList<Self>, pos: isize, value: Self)

source§

fn insert_clone(list: &mut QList<Self>, pos: isize, value: &Self)

source§

fn len(list: &QList<Self>) -> isize

source§

fn remove(list: &mut QList<Self>, pos: isize)

source§

fn reserve(list: &mut QList<Self>, size: isize)

source§

impl QSetElement for QDateTime

§

type TypeId = (Q, S, e, t, __, Q, D, a, t, e, T, i, m, e)

source§

fn clear(set: &mut QSet<Self>)

source§

fn clone(set: &QSet<Self>) -> QSet<Self>

source§

fn contains(set: &QSet<Self>, value: &Self) -> bool

source§

fn default() -> QSet<Self>

source§

fn drop(set: &mut QSet<Self>)

source§

unsafe fn get_unchecked(set: &QSet<Self>, pos: isize) -> &Self

Safety Read more
source§

fn insert(set: &mut QSet<Self>, value: Self)

source§

fn insert_clone(set: &mut QSet<Self>, value: &Self)

source§

fn len(set: &QSet<Self>) -> isize

source§

fn remove(set: &mut QSet<Self>, value: &Self) -> bool

source§

impl QVariantValue for QDateTime

source§

impl QVectorElement for QDateTime

§

type TypeId = (Q, V, e, c, t, o, r, __, Q, D, a, t, e, T, i, m, e)

source§

fn append(vector: &mut QVector<Self>, value: Self)

source§

fn append_clone(vector: &mut QVector<Self>, value: &Self)

source§

fn clear(vector: &mut QVector<Self>)

source§

fn clone(vector: &QVector<Self>) -> QVector<Self>

source§

fn contains(vector: &QVector<Self>, value: &Self) -> bool

source§

fn default() -> QVector<Self>

source§

fn drop(vector: &mut QVector<Self>)

source§

unsafe fn get_unchecked(vector: &QVector<Self>, pos: isize) -> &Self

Safety Read more
source§

fn index_of(vector: &QVector<Self>, value: &Self) -> isize

source§

fn insert(vector: &mut QVector<Self>, pos: isize, value: Self)

source§

fn insert_clone(vector: &mut QVector<Self>, pos: isize, value: &Self)

source§

fn len(vector: &QVector<Self>) -> isize

source§

fn remove(vector: &mut QVector<Self>, pos: isize)

source§

fn reserve(vector: &mut QVector<Self>, size: isize)

source§

impl Eq for QDateTime

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.