原始问题:
Ruby 如何将[19/May/2023:14:13:04 +0800]转换为2023-05-19 14:13:04.000格式
可以使用Ruby中的Time类,使用Time.parse("19/May/2023:14:13:04 +0800")来解析字符串,然后使用strftime方法来格式化时间:
Time.parse("19/May/2023:14:13:04 +0800").strftime('%Y-%m-%d %H:%M:%S.000') #=> "2023-05-19 14:13:04.000"
Ruby 如何将[19/May/2023:14:13:04 +0800]转换为2023-05-19 14:13:04.000格式
https://www.aiaiask.com/ask/26374.html
Prev:写一个TCP异常断开时重连的js