pub fn format_time(
format_str: &str,
source: TimeFormatStyle,
target: TimeFormatStyle,
) -> StringExpand description
Convert a time format string from one dialect style to another.
§Arguments
format_str- The format string to convertsource- The source format styletarget- The target format style
§Returns
The converted format string with specifiers replaced according to the target style. Literal text (not matching any known specifier) is preserved as-is.
§Example
use sqlglot_rust::dialects::time::{format_time, TimeFormatStyle};
let result = format_time("%Y-%m-%d", TimeFormatStyle::Strftime, TimeFormatStyle::Postgres);
assert_eq!(result, "YYYY-MM-DD");