pub struct OracleDate(/* private fields */);
Expand description
Oracle oriented Date
type.
Implementations§
Source§impl Date
impl Date
Sourcepub const MIN: Self
pub const MIN: Self
The smallest date that can be represented by Date
, i.e. 0001-01-01 00:00:00
.
Sourcepub const MAX: Self
pub const MAX: Self
The largest date that can be represented by Date
, i.e. 9999-12-31 23:59:59
.
Sourcepub const fn new(date: SqlDate, time: Time) -> Self
pub const fn new(date: SqlDate, time: Time) -> Self
Creates a new Oracle Date
from a date and a time.
Sourcepub const unsafe fn from_usecs_unchecked(usecs: i64) -> Self
pub const unsafe fn from_usecs_unchecked(usecs: i64) -> Self
Creates a Date
from the given microseconds from Unix Epoch without checking validity.
§Safety
This function is unsafe because the microsecond value is not checked for validity! Before using it, check that the value is correct.
Sourcepub const fn try_from_usecs(usecs: i64) -> Result<Self, Error>
pub const fn try_from_usecs(usecs: i64) -> Result<Self, Error>
Creates a Date
from the given microseconds from Unix Epoch
Sourcepub fn format<S: AsRef<str>>(self, fmt: S) -> Result<impl Display, Error>
pub fn format<S: AsRef<str>>(self, fmt: S) -> Result<impl Display, Error>
Formats Date
by given format string.
Sourcepub fn parse<S1: AsRef<str>, S2: AsRef<str>>(
input: S1,
fmt: S2,
) -> Result<Self, Error>
pub fn parse<S1: AsRef<str>, S2: AsRef<str>>( input: S1, fmt: S2, ) -> Result<Self, Error>
Parses Date
from given string and format.
Sourcepub fn add_interval_dt(self, interval: IntervalDT) -> Result<Date, Error>
pub fn add_interval_dt(self, interval: IntervalDT) -> Result<Date, Error>
Date
adds IntervalDT
Sourcepub fn add_interval_ym(self, interval: IntervalYM) -> Result<Date, Error>
pub fn add_interval_ym(self, interval: IntervalYM) -> Result<Date, Error>
Date
adds IntervalYM
Sourcepub fn sub_timestamp(self, timestamp: Timestamp) -> IntervalDT
pub fn sub_timestamp(self, timestamp: Timestamp) -> IntervalDT
Date
subtracts Timestamp
Sourcepub fn sub_interval_dt(self, interval: IntervalDT) -> Result<Date, Error>
pub fn sub_interval_dt(self, interval: IntervalDT) -> Result<Date, Error>
Date
subtracts IntervalDT
Sourcepub fn sub_interval_ym(self, interval: IntervalYM) -> Result<Date, Error>
pub fn sub_interval_ym(self, interval: IntervalYM) -> Result<Date, Error>
Date
subtracts IntervalYM
Sourcepub fn last_day_of_month(self) -> Date
pub fn last_day_of_month(self) -> Date
Gets the last day in month of Date
.
Sourcepub fn months_between(self, date: Date) -> (i32, i64)
pub fn months_between(self, date: Date) -> (i32, i64)
Gets months and microseconds of datetime between two Date
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Date
Available on crate features oracle
and serde
only.
impl<'de> Deserialize<'de> for Date
oracle
and serde
only.