Struct chrono::naive::time::NaiveTime
[-] [+]
[src]
pub struct NaiveTime { // some fields omitted }
ISO 8601 time without timezone. Allows for the nanosecond precision and optional leap second representation.
Methods
impl NaiveTime
fn from_hms(hour: u32, min: u32, sec: u32) -> NaiveTime
Makes a new NaiveTime
from hour, minute and second.
Fails on invalid hour, minute and/or second.
fn from_hms_opt(hour: u32, min: u32, sec: u32) -> Option<NaiveTime>
Makes a new NaiveTime
from hour, minute and second.
Returns None
on invalid hour, minute and/or second.
fn from_hms_milli(hour: u32, min: u32, sec: u32, milli: u32) -> NaiveTime
Makes a new NaiveTime
from hour, minute, second and millisecond.
The millisecond part can exceed 1,000 in order to represent the leap second.
Fails on invalid hour, minute, second and/or millisecond.
fn from_hms_milli_opt(hour: u32, min: u32, sec: u32, milli: u32) -> Option<NaiveTime>
Makes a new NaiveTime
from hour, minute, second and millisecond.
The millisecond part can exceed 1,000 in order to represent the leap second.
Returns None
on invalid hour, minute, second and/or millisecond.
fn from_hms_micro(hour: u32, min: u32, sec: u32, micro: u32) -> NaiveTime
Makes a new NaiveTime
from hour, minute, second and microsecond.
The microsecond part can exceed 1,000,000 in order to represent the leap second.
Fails on invalid hour, minute, second and/or microsecond.
fn from_hms_micro_opt(hour: u32, min: u32, sec: u32, micro: u32) -> Option<NaiveTime>
Makes a new NaiveTime
from hour, minute, second and microsecond.
The microsecond part can exceed 1,000,000 in order to represent the leap second.
Returns None
on invalid hour, minute, second and/or microsecond.
fn from_hms_nano(hour: u32, min: u32, sec: u32, nano: u32) -> NaiveTime
Makes a new NaiveTime
from hour, minute, second and nanosecond.
The nanosecond part can exceed 1,000,000,000 in order to represent the leap second.
Fails on invalid hour, minute, second and/or nanosecond.
fn from_hms_nano_opt(hour: u32, min: u32, sec: u32, nano: u32) -> Option<NaiveTime>
Makes a new NaiveTime
from hour, minute, second and nanosecond.
The nanosecond part can exceed 1,000,000,000 in order to represent the leap second.
Returns None
on invalid hour, minute, second and/or nanosecond.
fn from_num_seconds_from_midnight(secs: u32, nano: u32) -> NaiveTime
Makes a new NaiveTime
from the number of seconds since midnight and nanosecond.
The nanosecond part can exceed 1,000,000,000 in order to represent the leap second.
Fails on invalid number of seconds and/or nanosecond.
fn from_num_seconds_from_midnight_opt(secs: u32, nano: u32) -> Option<NaiveTime>
Makes a new NaiveTime
from the number of seconds since midnight and nanosecond.
The nanosecond part can exceed 1,000,000,000 in order to represent the leap second.
Returns None
on invalid number of seconds and/or nanosecond.
fn parse_from_str(s: &str, fmt: &str) -> ParseResult<NaiveTime>
Parses a string with the specified format string and returns a new NaiveTime
.
See the format::strftime
module on the supported escape sequences.
fn format_with_items<'a, I>(&self, items: I) -> DelayedFormat<I> where I: Iterator<Item=Item<'a>> + Clone
Formats the time with the specified formatting items.
fn format<'a>(&self, fmt: &'a str) -> DelayedFormat<StrftimeItems<'a>>
Formats the time with the specified format string.
See the format::strftime
module on the supported escape sequences.