from_string

Function from_string 

Source
pub fn from_string(string: &str) -> Result<DateTime<Local>, ParseDateError>
Expand description

Parses a string representing a date and returns the corresponding DateTime<Local>.

This function takes a date string, parses it using the pest parser, and returns the resulting DateTime<Local> if successful, or an error if the string cannot be parsed.

§Arguments

  • string - The string to be parsed as a date.

§Returns

  • Result<DateTime<Local>, ParseDateError> - A DateTime<Local> if parsing is successful, or a ParseDateError if there was an issue.