Parse a string containing date and time in a custom format

后端 未结 3 786
南旧
南旧 2020-11-30 09:19

I have a string of the next format \"ORDER20100322194007\", where 20100322 is a date and 194007 is a time. How to parse a string and g

3条回答
  •  南方客
    南方客 (楼主)
    2020-11-30 10:22

    If you don't have a fixed structure of your string say order will not always be there then you can use regex to separate the numbers and characters and then use convert to datetime function for the numbers separated.

提交回复
热议问题