pub fn parse_datetime_at_date<S: AsRef<str> + Clone>(
date: Zoned,
input: S,
) -> Result<Zoned, ParseDateTimeError>
Expand description
Parses a time string at a specific date and returns a Zoned
object
representing the absolute time of the string.
§Arguments
- date - The date represented in local time
input
- A string slice representing the time.
§Examples
use jiff::Zoned;
use parse_datetime::parse_datetime_at_date;
let now = Zoned::now();
let after = parse_datetime_at_date(now, "2024-09-13UTC +3 days").unwrap();
assert_eq!(
"2024-09-16",
after.strftime("%F").to_string()
);
§Returns
Ok(Zoned)
- If the input string can be parsed as a timeErr(ParseDateTimeError)
- If the input string cannot be parsed as a relative time
§Errors
This function will return Err(ParseDateTimeError::InvalidInput)
if the
input string cannot be parsed as a relative time.