Struct icu_capi::datetime::ffi::IsoDateTime
source · pub struct IsoDateTime(pub DateTime<Iso>);
Expand description
An ICU4X DateTime object capable of containing a ISO-8601 date and time.
Tuple Fields§
§0: DateTime<Iso>
Implementations§
source§impl IsoDateTime
impl IsoDateTime
sourcepub fn create(
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
nanosecond: u32,
) -> Result<Box<IsoDateTime>, CalendarError>
pub fn create( year: i32, month: u8, day: u8, hour: u8, minute: u8, second: u8, nanosecond: u32, ) -> Result<Box<IsoDateTime>, CalendarError>
Creates a new IsoDateTime
from the specified date and time.
sourcepub fn from_date_and_time(date: &IsoDate, time: &Time) -> Box<IsoDateTime>
pub fn from_date_and_time(date: &IsoDate, time: &Time) -> Box<IsoDateTime>
Creates a new IsoDateTime
from an IsoDate
and Time
object
sourcepub fn from_string(
v: &DiplomatStr,
) -> Result<Box<IsoDateTime>, CalendarParseError>
pub fn from_string( v: &DiplomatStr, ) -> Result<Box<IsoDateTime>, CalendarParseError>
Creates a new IsoDateTime
from an IXDTF string.
sourcepub fn to_any(&self) -> Box<DateTime>
pub fn to_any(&self) -> Box<DateTime>
Converts this to an DateTime
capable of being mixed with dates of
other calendars
sourcepub fn to_calendar(&self, calendar: &Calendar) -> Box<DateTime>
pub fn to_calendar(&self, calendar: &Calendar) -> Box<DateTime>
Convert this datetime to one in a different calendar
sourcepub fn nanosecond(&self) -> u32
pub fn nanosecond(&self) -> u32
Returns the nanosecond in this time
sourcepub fn day_of_year(&self) -> u16
pub fn day_of_year(&self) -> u16
Returns the 1-indexed day in the year for this date
sourcepub fn day_of_month(&self) -> u8
pub fn day_of_month(&self) -> u8
Returns the 1-indexed day in the month for this date
sourcepub fn day_of_week(&self) -> IsoWeekday
pub fn day_of_week(&self) -> IsoWeekday
Returns the day in the week for this day
sourcepub fn week_of_month(&self, first_weekday: IsoWeekday) -> u8
pub fn week_of_month(&self, first_weekday: IsoWeekday) -> u8
Returns the week number in this month, 1-indexed, based on what is considered the first day of the week (often a locale preference).
first_weekday
can be obtained via first_weekday()
on WeekCalculator
sourcepub fn week_of_year(&self, calculator: &WeekCalculator) -> WeekOf
pub fn week_of_year(&self, calculator: &WeekCalculator) -> WeekOf
Returns the week number in this year, using week data
sourcepub fn is_in_leap_year(&self) -> bool
pub fn is_in_leap_year(&self) -> bool
Returns whether this date is in a leap year
sourcepub fn months_in_year(&self) -> u8
pub fn months_in_year(&self) -> u8
Returns the number of months in the year represented by this date
sourcepub fn days_in_month(&self) -> u8
pub fn days_in_month(&self) -> u8
Returns the number of days in the month represented by this date
sourcepub fn days_in_year(&self) -> u16
pub fn days_in_year(&self) -> u16
Returns the number of days in the year represented by this date
Auto Trait Implementations§
impl Freeze for IsoDateTime
impl RefUnwindSafe for IsoDateTime
impl Send for IsoDateTime
impl Sync for IsoDateTime
impl Unpin for IsoDateTime
impl UnwindSafe for IsoDateTime
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more