Struct time::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, }
Holds a calendar date and time broken down into its components (year, month, day, and so on), also called a broken-down time value.
Fields
Methods
impl Tm
fn to_timespec(&self) -> Timespec
Convert time to the seconds from January 1, 1970
fn to_local(&self) -> Tm
Convert time to the local timezone
fn to_utc(&self) -> Tm
Convert time to the UTC
fn ctime(&self) -> TmFmt
Returns a TmFmt that outputs according to the asctime
format in ISO
C, in the local timezone.
Example: "Thu Jan 1 00:00:00 1970"
fn asctime(&self) -> TmFmt
Returns a TmFmt that outputs according to the asctime
format in ISO
C.
Example: "Thu Jan 1 00:00:00 1970"
fn strftime<'a>(&'a self, format: &'a str) -> Result<TmFmt<'a>, ParseError>
Formats the time according to the format string.
fn rfc822(&self) -> TmFmt
Returns a TmFmt that outputs according to RFC 822.
local: "Thu, 22 Mar 2012 07:53:18 PST" utc: "Thu, 22 Mar 2012 14:53:18 GMT"
fn rfc822z(&self) -> TmFmt
Returns a TmFmt that outputs according to RFC 822 with Zulu time.
local: "Thu, 22 Mar 2012 07:53:18 -0700" utc: "Thu, 22 Mar 2012 14:53:18 -0000"
fn rfc3339<'a>(&'a self) -> TmFmt
Returns a TmFmt that outputs according to RFC 3339. RFC 3339 is compatible with ISO 8601.
local: "2012-02-22T07:53:18-07:00" utc: "2012-02-22T14:53:18Z"