简体   繁体   中英

Parsing string date to date format

I'm having issues parsing a string to a date format.

This is my string 7/13/2022 9:46 AM

As per the documentation , I'm trying PARSE_DATETIME("%x %R %p", datetime_closed) or PARSE_DATETIME("%D %E4Y %R %p", "7/13/2022 9:46 AM")

I've tried other combinations but none of them works

Use PARSE_DATETIME("%m/%d/%Y %l:%M %p", datetime_closed) to get datetime or DATE(PARSE_DATETIME("%m/%d/%Y %l:%M %p", datetime_closed)) to get date

You can use the format below:

PARSE_DATETIME('%m/%d/%Y %l:%M %p', "7/13/2022 9:46 AM")

The output:

parse_datetime_output

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM