Add support for providing Chrono formats when parsing strings -> datetime/nanos and Parser implementations #5303
Labels
development-process
Related to development process of arrow-rs
enhancement
Any new improvement worthy of a entry in the changelog
This is related to apache/datafusion#5398 where functions for parsing string -> datetime and string -> nanos would be added to include a second 'format' parameter. The format would be a chrono format (https://docs.rs/chrono/latest/chrono/format/strftime/index.html) and would return an Err if the string couldn't be parsed with the provided format.
The proposed two new functions that would be added would be :
pub fn string_to_datetime_formatted<T: TimeZone>(timezone: &T, s: &str, format: &str) -> Result<DateTime<T>, ArrowError>
(mirrors the existing string_to_datetime function)pub fn string_to_timestamp_nanos_formatted(s: &str, format: &str) -> Result<i64, ArrowError>
(mirrors the existing string_to_timestamp_nanos function)In addition, for completeness all the existing Parser implementations in that file would be updated to include a 'parse_formatted' implementation where missing.
The text was updated successfully, but these errors were encountered: