Trait DateTimeMethods

Source
pub trait DateTimeMethods: WxRustMethods {
Show 54 methods // Provided methods fn reset_time(&self) -> &Self { ... } fn set_tm(&self, tm: *const c_void) -> &Self { ... } fn set_double(&self, jdn: c_double) -> &Self { ... } fn set_to_current(&self) -> &Self { ... } fn set_year(&self, year: c_int) -> &Self { ... } fn set_from_msw_sys_time(&self, st: *const c_void) -> &Self { ... } fn get_as_msw_sys_time(&self, st: *mut c_void) { ... } fn get_century_timezone(&self, tz: *const c_void) -> c_int { ... } fn get_date_only(&self) -> DateTime { ... } fn get_week_based_year(&self, tz: *const c_void) -> c_int { ... } fn get_year(&self, tz: *const c_void) -> c_int { ... } fn is_valid(&self) -> bool { ... } fn is_earlier_than<D: DateTimeMethods>(&self, datetime: &D) -> bool { ... } fn is_equal_to<D: DateTimeMethods>(&self, datetime: &D) -> bool { ... } fn is_equal_up_to<D: DateTimeMethods>( &self, dt: &D, ts: *const c_void, ) -> bool { ... } fn is_later_than<D: DateTimeMethods>(&self, datetime: &D) -> bool { ... } fn is_same_date<D: DateTimeMethods>(&self, dt: &D) -> bool { ... } fn is_same_time<D: DateTimeMethods>(&self, dt: &D) -> bool { ... } fn is_strictly_between<D: DateTimeMethods, D2: DateTimeMethods>( &self, t1: &D, t2: &D2, ) -> bool { ... } fn is_between<D: DateTimeMethods, D2: DateTimeMethods>( &self, t1: &D, t2: &D2, ) -> bool { ... } fn add_datespan(&self, diff: *const c_void) -> &Self { ... } fn add_timespan(&self, diff: *const c_void) -> &Self { ... } fn subtract_timespan(&self, diff: *const c_void) -> &Self { ... } fn subtract_datespan(&self, diff: *const c_void) -> &Self { ... } fn format(&self, format: &str, tz: *const c_void) -> String { ... } fn format_date(&self) -> String { ... } fn format_iso_date(&self) -> String { ... } fn format_iso_time(&self) -> String { ... } fn format_time(&self) -> String { ... } fn parse_date_time(&self, datetime: &str, end: *mut c_void) -> bool { ... } fn parse_format<D: DateTimeMethods>( &self, date: &str, format: &str, date_def: &D, end: *mut c_void, ) -> bool { ... } fn parse_iso_date(&self, date: &str) -> bool { ... } fn parse_iso_time(&self, date: &str) -> bool { ... } fn parse_rfc822_date(&self, date: &str, end: *mut c_void) -> bool { ... } fn parse_time(&self, time: &str, end: *mut c_void) -> bool { ... } fn get_jdn(&self) -> c_double { ... } fn get_julian_day_number(&self) -> c_double { ... } fn get_mjd(&self) -> c_double { ... } fn get_modified_julian_day_number(&self) -> c_double { ... } fn get_rata_die(&self) -> c_double { ... } fn from_timezone(&self, tz: *const c_void, no_dst: bool) -> DateTime { ... } fn make_from_timezone(&self, tz: *const c_void, no_dst: bool) -> &Self { ... } fn make_timezone(&self, tz: *const c_void, no_dst: bool) -> &Self { ... } fn make_utc(&self, no_dst: bool) -> &Self { ... } fn to_timezone(&self, tz: *const c_void, no_dst: bool) -> DateTime { ... } fn to_utc(&self, no_dst: bool) -> DateTime { ... } fn convert_year_to_bc(year: c_int) -> c_int { ... } fn get_am_pm_strings(am: *mut c_void, pm: *mut c_void) { ... } fn get_century_int(year: c_int) -> c_int { ... } fn get_tm_now() -> *mut c_void { ... } fn get_first_week_day(first_day: *mut c_void) -> bool { ... } fn now() -> DateTime { ... } fn today() -> DateTime { ... } fn u_now() -> DateTime { ... }
}
Expand description

This trait represents C++ wxDateTime class’s methods and inheritance.

See DateTimeIsOwned documentation for the class usage.

Provided Methods§

Source

fn reset_time(&self) -> &Self

Reset time to midnight (00:00:00) without changing the date.

See C++ wxDateTime::ResetTime()’s documentation.

Source

fn set_tm(&self, tm: *const c_void) -> &Self

Sets the date and time from the broken down representation in the wxDateTime::Tm structure.

See C++ wxDateTime::Set()’s documentation.

Source

fn set_double(&self, jdn: c_double) -> &Self

Sets the date from the so-called Julian Day Number.

See C++ wxDateTime::Set()’s documentation.

Source

fn set_to_current(&self) -> &Self

Sets the date and time of to the current values.

See C++ wxDateTime::SetToCurrent()’s documentation.

Source

fn set_year(&self, year: c_int) -> &Self

Sets the year without changing other date components.

See C++ wxDateTime::SetYear()’s documentation.

Source

fn set_from_msw_sys_time(&self, st: *const c_void) -> &Self

Initialize using the Windows SYSTEMTIME structure.

See C++ wxDateTime::SetFromMSWSysTime()’s documentation.

Source

fn get_as_msw_sys_time(&self, st: *mut c_void)

Returns the date and time in the Windows SYSTEMTIME format.

See C++ wxDateTime::GetAsMSWSysTime()’s documentation.

Source

fn get_century_timezone(&self, tz: *const c_void) -> c_int

Returns the century of this date.

See C++ wxDateTime::GetCentury()’s documentation.

Source

fn get_date_only(&self) -> DateTime

Returns the object having the same date component as this one but time of 00:00:00.

See C++ wxDateTime::GetDateOnly()’s documentation.

Source

fn get_week_based_year(&self, tz: *const c_void) -> c_int

Returns the year to which the week containing this date belongs.

See C++ wxDateTime::GetWeekBasedYear()’s documentation.

Source

fn get_year(&self, tz: *const c_void) -> c_int

Returns the year in the given timezone (local one by default).

See C++ wxDateTime::GetYear()’s documentation.

Source

fn is_valid(&self) -> bool

Returns true if the object represents a valid time moment.

See C++ wxDateTime::IsValid()’s documentation.

Source

fn is_earlier_than<D: DateTimeMethods>(&self, datetime: &D) -> bool

Returns true if this date precedes the given one.

See C++ wxDateTime::IsEarlierThan()’s documentation.

Source

fn is_equal_to<D: DateTimeMethods>(&self, datetime: &D) -> bool

Returns true if the two dates are strictly identical.

See C++ wxDateTime::IsEqualTo()’s documentation.

Source

fn is_equal_up_to<D: DateTimeMethods>(&self, dt: &D, ts: *const c_void) -> bool

Returns true if the date is equal to another one up to the given time interval, i.e. if the absolute difference between the two dates is less than this interval.

See C++ wxDateTime::IsEqualUpTo()’s documentation.

Source

fn is_later_than<D: DateTimeMethods>(&self, datetime: &D) -> bool

Returns true if this date is later than the given one.

See C++ wxDateTime::IsLaterThan()’s documentation.

Source

fn is_same_date<D: DateTimeMethods>(&self, dt: &D) -> bool

Returns true if the date is the same without comparing the time parts.

See C++ wxDateTime::IsSameDate()’s documentation.

Source

fn is_same_time<D: DateTimeMethods>(&self, dt: &D) -> bool

Returns true if the time is the same (although dates may differ).

See C++ wxDateTime::IsSameTime()’s documentation.

Source

fn is_strictly_between<D: DateTimeMethods, D2: DateTimeMethods>( &self, t1: &D, t2: &D2, ) -> bool

Returns true if this date lies strictly between the two given dates.

See C++ wxDateTime::IsStrictlyBetween()’s documentation.

Source

fn is_between<D: DateTimeMethods, D2: DateTimeMethods>( &self, t1: &D, t2: &D2, ) -> bool

Returns true if IsStrictlyBetween() is true or if the date is equal to one of the limit values.

See C++ wxDateTime::IsBetween()’s documentation.

Source

fn add_datespan(&self, diff: *const c_void) -> &Self

Adds the given date span to this object.

See C++ wxDateTime::Add()’s documentation.

Source

fn add_timespan(&self, diff: *const c_void) -> &Self

Adds the given time span to this object.

See C++ wxDateTime::Add()’s documentation.

Source

fn subtract_timespan(&self, diff: *const c_void) -> &Self

Subtracts the given time span from this object.

See C++ wxDateTime::Subtract()’s documentation.

Source

fn subtract_datespan(&self, diff: *const c_void) -> &Self

Subtracts the given date span from this object.

See C++ wxDateTime::Subtract()’s documentation.

Source

fn format(&self, format: &str, tz: *const c_void) -> String

This function does the same as the standard ANSI C strftime(3) function (http://www.cplusplus.com/reference/clibrary/ctime/strftime.html).

See C++ wxDateTime::Format()’s documentation.

Source

fn format_date(&self) -> String

Identical to calling Format() with “%x” argument (which means “preferred date representation for the current locale”).

See C++ wxDateTime::FormatDate()’s documentation.

Source

fn format_iso_date(&self) -> String

This function returns the date representation in the ISO 8601 format “YYYY-MM-DD”.

See C++ wxDateTime::FormatISODate()’s documentation.

Source

fn format_iso_time(&self) -> String

This function returns the time representation in the ISO 8601 format “HH:MM:SS”.

See C++ wxDateTime::FormatISOTime()’s documentation.

Source

fn format_time(&self) -> String

Identical to calling Format() with “%X” argument (which means “preferred time representation for the current locale”).

See C++ wxDateTime::FormatTime()’s documentation.

Source

fn parse_date_time(&self, datetime: &str, end: *mut c_void) -> bool

Parses the string datetime containing the date and time in free format.

See C++ wxDateTime::ParseDateTime()’s documentation.

Source

fn parse_format<D: DateTimeMethods>( &self, date: &str, format: &str, date_def: &D, end: *mut c_void, ) -> bool

This function parses the string date according to the given format.

See C++ wxDateTime::ParseFormat()’s documentation.

Source

fn parse_iso_date(&self, date: &str) -> bool

This function parses the date in ISO 8601 format “YYYY-MM-DD”.

See C++ wxDateTime::ParseISODate()’s documentation.

Source

fn parse_iso_time(&self, date: &str) -> bool

This function parses the time in ISO 8601 format “HH:MM:SS”.

See C++ wxDateTime::ParseISOTime()’s documentation.

Source

fn parse_rfc822_date(&self, date: &str, end: *mut c_void) -> bool

Parses the string date looking for a date formatted according to the RFC 822 in it.

See C++ wxDateTime::ParseRfc822Date()’s documentation.

Source

fn parse_time(&self, time: &str, end: *mut c_void) -> bool

This functions is like ParseDateTime(), but only allows the time to be specified in the input string.

See C++ wxDateTime::ParseTime()’s documentation.

Source

fn get_jdn(&self) -> c_double

Synonym for GetJulianDayNumber().

See C++ wxDateTime::GetJDN()’s documentation.

Source

fn get_julian_day_number(&self) -> c_double

Returns the JDN corresponding to this date.

See C++ wxDateTime::GetJulianDayNumber()’s documentation.

Source

fn get_mjd(&self) -> c_double

Synonym for GetModifiedJulianDayNumber().

See C++ wxDateTime::GetMJD()’s documentation.

Source

fn get_modified_julian_day_number(&self) -> c_double

Returns the “Modified Julian Day Number” (MJD) which is, by definition, is equal to JDN - 2400000.5.

See C++ wxDateTime::GetModifiedJulianDayNumber()’s documentation.

Source

fn get_rata_die(&self) -> c_double

Return the Rata Die number of this date.

See C++ wxDateTime::GetRataDie()’s documentation.

Source

fn from_timezone(&self, tz: *const c_void, no_dst: bool) -> DateTime

Transform the date from the given time zone to the local one.

See C++ wxDateTime::FromTimezone()’s documentation.

Source

fn make_from_timezone(&self, tz: *const c_void, no_dst: bool) -> &Self

Same as FromTimezone() but modifies the object in place.

See C++ wxDateTime::MakeFromTimezone()’s documentation.

Source

fn make_timezone(&self, tz: *const c_void, no_dst: bool) -> &Self

Modifies the object in place to represent the date in another time zone.

See C++ wxDateTime::MakeTimezone()’s documentation.

Source

fn make_utc(&self, no_dst: bool) -> &Self

This is the same as calling MakeTimezone() with the argument GMT0.

See C++ wxDateTime::MakeUTC()’s documentation.

Source

fn to_timezone(&self, tz: *const c_void, no_dst: bool) -> DateTime

Transform the date to the given time zone.

See C++ wxDateTime::ToTimezone()’s documentation.

Source

fn to_utc(&self, no_dst: bool) -> DateTime

This is the same as calling ToTimezone() with the argument GMT0.

See C++ wxDateTime::ToUTC()’s documentation.

Source

fn convert_year_to_bc(year: c_int) -> c_int

Converts the year in absolute notation (i.e. a number which can be negative, positive or zero) to the year in BC/AD notation.

See C++ wxDateTime::ConvertYearToBC()’s documentation.

Source

fn get_am_pm_strings(am: *mut c_void, pm: *mut c_void)

Returns the translations of the strings AM and PM used for time formatting for the current locale.

See C++ wxDateTime::GetAmPmStrings()’s documentation.

Source

fn get_century_int(year: c_int) -> c_int

Get the current century, i.e. first two digits of the year, in given calendar (only Gregorian is currently supported).

See C++ wxDateTime::GetCentury()’s documentation.

Source

fn get_tm_now() -> *mut c_void

Returns the current time broken down.

See C++ wxDateTime::GetTmNow()’s documentation.

Source

fn get_first_week_day(first_day: *mut c_void) -> bool

Acquires the first weekday of a week based on locale and/or OS settings.

See C++ wxDateTime::GetFirstWeekDay()’s documentation.

Source

fn now() -> DateTime

Returns the object corresponding to the current time in local time zone.

See C++ wxDateTime::Now()’s documentation.

Source

fn today() -> DateTime

Returns the object corresponding to the midnight of the current day (i.e. the same as Now(), but the time part is set to 0).

See C++ wxDateTime::Today()’s documentation.

Source

fn u_now() -> DateTime

Returns the object corresponding to the current time including the milliseconds.

See C++ wxDateTime::UNow()’s documentation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<const OWNED: bool> DateTimeMethods for DateTimeIsOwned<OWNED>