Struct ptime::Tm
[−]
[src]
pub struct Tm { pub tm_sec: i32, pub tm_min: i32, pub tm_hour: i32, pub tm_mday: i32, pub tm_mon: i32, pub tm_year: i32, pub tm_wday: i32, pub tm_yday: i32, pub tm_isdst: i32, pub tm_utcoff: i32, pub tm_nsec: i32, }
Represents the components of a moment in time in Persian Calendar.
Fields
tm_sec: i32
The same as tm_sec
of time::Tm
tm_min: i32
The same as tm_min
of time::Tm
tm_hour: i32
The same as tm_hour
of time::Tm
tm_mday: i32
MonthDay - [1, 31]
tm_mon: i32
Month since Farvardin - [0, 11]
tm_year: i32
Year
tm_wday: i32
Weekday since Shanbe - [0, 6]. 0 = Shanbeh, ..., 6 = Jomeh.
tm_yday: i32
YearDay since Farvardin 1 - [0, 365]
tm_isdst: i32
The same as tm_isdst
of time::Tm
tm_utcoff: i32
The same as tm_utcoff
of time::Tm
tm_nsec: i32
The same as tm_nsec
of time::Tm
Methods
impl Tm
[src]
fn to_gregorian(&self) -> Tm
Converts Persian calendar to Gregorian calendar
fn to_timespec(&self) -> Timespec
Returns the number of seconds since January 1, 1970 UTC
fn is_leap(&self) -> bool
Returns true if the year is a leap year
fn to_local(&self) -> Tm
Convert time to the local timezone
fn to_utc(&self) -> Tm
Convert time to the UTC
fn to_string<'a>(&'a self, format: &'a str) -> String
Returns the formatted representation of time yyyy, yyy, y year (e.g. 1394) yy 2-digits representation of year (e.g. 94) MMM the Persian name of month (e.g. فروردین) MM 2-digits representation of month (e.g. 01) M month (e.g. 1) DD day of year (starting from 1) D day of year (starting from 0) dd 2-digits representation of day (e.g. 01) d day (e.g. 1) E the Persian name of weekday (e.g. شنبه) e the Persian short name of weekday (e.g. ش) A the Persian name of 12-Hour marker (e.g. قبل از ظهر) a the Persian short name of 12-Hour marker (e.g. ق.ظ) HH 2-digits representation of hour [00-23] H hour [0-23] kk 2-digits representation of hour [01-24] k hour [1-24] hh 2-digits representation of hour [01-12] h hour [1-12] KK 2-digits representation of hour [00-11] K hour [0-11] mm 2-digits representation of minute [00-59] m minute [0-59] ss 2-digits representation of seconds [00-59] s seconds [0-59] ns nanoseconds
Trait Implementations
impl Copy for Tm
[src]
impl Clone for Tm
[src]
fn clone(&self) -> Tm
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Tm
[src]
fn eq(&self, __arg_0: &Tm) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Tm) -> bool
This method tests for !=
.
impl Eq for Tm
[src]
impl Debug for Tm
[src]
impl Hash for Tm
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Display for Tm
[src]
impl Add<Duration> for Tm
[src]
type Output = Tm
The resulting type after applying the +
operator
fn add(self, other: Duration) -> Tm
The method for the +
operator
impl Sub<Duration> for Tm
[src]
type Output = Tm
The resulting type after applying the -
operator
fn sub(self, other: Duration) -> Tm
The method for the -
operator
impl Sub<Tm> for Tm
[src]
type Output = Duration
The resulting type after applying the -
operator
fn sub(self, other: Tm) -> Duration
The method for the -
operator
impl Sub<Tm> for Tm
[src]
type Output = Duration
The resulting type after applying the -
operator
fn sub(self, other: Tm) -> Duration
The method for the -
operator
impl PartialOrd for Tm
[src]
fn partial_cmp(&self, other: &Tm) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more