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§
Sourcefn reset_time(&self) -> &Self
fn reset_time(&self) -> &Self
Reset time to midnight (00:00:00) without changing the date.
Sourcefn set_tm(&self, tm: *const c_void) -> &Self
fn set_tm(&self, tm: *const c_void) -> &Self
Sets the date and time from the broken down representation in the wxDateTime::Tm structure.
Sourcefn set_double(&self, jdn: c_double) -> &Self
fn set_double(&self, jdn: c_double) -> &Self
Sets the date from the so-called Julian Day Number.
Sourcefn set_to_current(&self) -> &Self
fn set_to_current(&self) -> &Self
Sets the date and time of to the current values.
Sourcefn set_from_msw_sys_time(&self, st: *const c_void) -> &Self
fn set_from_msw_sys_time(&self, st: *const c_void) -> &Self
Initialize using the Windows SYSTEMTIME structure.
Sourcefn get_as_msw_sys_time(&self, st: *mut c_void)
fn get_as_msw_sys_time(&self, st: *mut c_void)
Returns the date and time in the Windows SYSTEMTIME format.
Sourcefn get_century_timezone(&self, tz: *const c_void) -> c_int
fn get_century_timezone(&self, tz: *const c_void) -> c_int
Returns the century of this date.
Sourcefn get_date_only(&self) -> DateTime
fn get_date_only(&self) -> DateTime
Returns the object having the same date component as this one but time of 00:00:00.
Sourcefn get_week_based_year(&self, tz: *const c_void) -> c_int
fn get_week_based_year(&self, tz: *const c_void) -> c_int
Returns the year to which the week containing this date belongs.
Sourcefn get_year(&self, tz: *const c_void) -> c_int
fn get_year(&self, tz: *const c_void) -> c_int
Returns the year in the given timezone (local one by default).
Sourcefn is_earlier_than<D: DateTimeMethods>(&self, datetime: &D) -> bool
fn is_earlier_than<D: DateTimeMethods>(&self, datetime: &D) -> bool
Returns true if this date precedes the given one.
Sourcefn is_equal_to<D: DateTimeMethods>(&self, datetime: &D) -> bool
fn is_equal_to<D: DateTimeMethods>(&self, datetime: &D) -> bool
Returns true if the two dates are strictly identical.
Sourcefn is_equal_up_to<D: DateTimeMethods>(&self, dt: &D, ts: *const c_void) -> bool
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.
Sourcefn is_later_than<D: DateTimeMethods>(&self, datetime: &D) -> bool
fn is_later_than<D: DateTimeMethods>(&self, datetime: &D) -> bool
Returns true if this date is later than the given one.
Sourcefn is_same_date<D: DateTimeMethods>(&self, dt: &D) -> bool
fn is_same_date<D: DateTimeMethods>(&self, dt: &D) -> bool
Returns true if the date is the same without comparing the time parts.
Sourcefn is_same_time<D: DateTimeMethods>(&self, dt: &D) -> bool
fn is_same_time<D: DateTimeMethods>(&self, dt: &D) -> bool
Returns true if the time is the same (although dates may differ).
Sourcefn is_strictly_between<D: DateTimeMethods, D2: DateTimeMethods>(
&self,
t1: &D,
t2: &D2,
) -> bool
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.
Sourcefn is_between<D: DateTimeMethods, D2: DateTimeMethods>(
&self,
t1: &D,
t2: &D2,
) -> bool
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.
Sourcefn add_datespan(&self, diff: *const c_void) -> &Self
fn add_datespan(&self, diff: *const c_void) -> &Self
Adds the given date span to this object.
Sourcefn add_timespan(&self, diff: *const c_void) -> &Self
fn add_timespan(&self, diff: *const c_void) -> &Self
Adds the given time span to this object.
Sourcefn subtract_timespan(&self, diff: *const c_void) -> &Self
fn subtract_timespan(&self, diff: *const c_void) -> &Self
Subtracts the given time span from this object.
Sourcefn subtract_datespan(&self, diff: *const c_void) -> &Self
fn subtract_datespan(&self, diff: *const c_void) -> &Self
Subtracts the given date span from this object.
Sourcefn format(&self, format: &str, tz: *const c_void) -> String
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).
Sourcefn format_date(&self) -> String
fn format_date(&self) -> String
Identical to calling Format() with “%x” argument (which means “preferred date representation for the current locale”).
Sourcefn format_iso_date(&self) -> String
fn format_iso_date(&self) -> String
This function returns the date representation in the ISO 8601 format “YYYY-MM-DD”.
Sourcefn format_iso_time(&self) -> String
fn format_iso_time(&self) -> String
This function returns the time representation in the ISO 8601 format “HH:MM:SS”.
Sourcefn format_time(&self) -> String
fn format_time(&self) -> String
Identical to calling Format() with “%X” argument (which means “preferred time representation for the current locale”).
Sourcefn parse_date_time(&self, datetime: &str, end: *mut c_void) -> bool
fn parse_date_time(&self, datetime: &str, end: *mut c_void) -> bool
Parses the string datetime containing the date and time in free format.
Sourcefn parse_format<D: DateTimeMethods>(
&self,
date: &str,
format: &str,
date_def: &D,
end: *mut c_void,
) -> bool
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.
Sourcefn parse_iso_date(&self, date: &str) -> bool
fn parse_iso_date(&self, date: &str) -> bool
This function parses the date in ISO 8601 format “YYYY-MM-DD”.
Sourcefn parse_iso_time(&self, date: &str) -> bool
fn parse_iso_time(&self, date: &str) -> bool
This function parses the time in ISO 8601 format “HH:MM:SS”.
Sourcefn parse_rfc822_date(&self, date: &str, end: *mut c_void) -> bool
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.
Sourcefn parse_time(&self, time: &str, end: *mut c_void) -> bool
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.
Sourcefn get_julian_day_number(&self) -> c_double
fn get_julian_day_number(&self) -> c_double
Returns the JDN corresponding to this date.
Sourcefn get_modified_julian_day_number(&self) -> c_double
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.
Sourcefn get_rata_die(&self) -> c_double
fn get_rata_die(&self) -> c_double
Return the Rata Die number of this date.
Sourcefn from_timezone(&self, tz: *const c_void, no_dst: bool) -> DateTime
fn from_timezone(&self, tz: *const c_void, no_dst: bool) -> DateTime
Transform the date from the given time zone to the local one.
Sourcefn make_from_timezone(&self, tz: *const c_void, no_dst: bool) -> &Self
fn make_from_timezone(&self, tz: *const c_void, no_dst: bool) -> &Self
Same as FromTimezone() but modifies the object in place.
Sourcefn make_timezone(&self, tz: *const c_void, no_dst: bool) -> &Self
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.
Sourcefn make_utc(&self, no_dst: bool) -> &Self
fn make_utc(&self, no_dst: bool) -> &Self
This is the same as calling MakeTimezone() with the argument GMT0.
Sourcefn to_timezone(&self, tz: *const c_void, no_dst: bool) -> DateTime
fn to_timezone(&self, tz: *const c_void, no_dst: bool) -> DateTime
Transform the date to the given time zone.
Sourcefn to_utc(&self, no_dst: bool) -> DateTime
fn to_utc(&self, no_dst: bool) -> DateTime
This is the same as calling ToTimezone() with the argument GMT0.
Sourcefn convert_year_to_bc(year: c_int) -> c_int
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.
Sourcefn get_am_pm_strings(am: *mut c_void, pm: *mut c_void)
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.
Sourcefn get_century_int(year: c_int) -> c_int
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).
Sourcefn get_tm_now() -> *mut c_void
fn get_tm_now() -> *mut c_void
Returns the current time broken down.
Sourcefn get_first_week_day(first_day: *mut c_void) -> bool
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.
Sourcefn today() -> DateTime
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).
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.