Repository navigation
考虑支持更多的字符串格式解析
#283
|
之前我使用 |
Answered by
gouguoyin
Mar 27, 2025
Replies: 3 comments 1 reply
|
more formats can be used with |
1 reply
|
We can add a method to set the layout maps for parsing |
0 replies
|
Added c := carbon.ParseWithLayouts("2020|08|05 13|14|15", []string{"2006|01|02 15|04|05", "2006|1|2 3|4|5"})
fmt.Println(c.ToString())
fmt.Println(c.CurrentLayout())
// Output:
// 2020-08-05 13:14:15 +0000 UTC
// 2006|01|02 15|04|05 |
0 replies
Answer selected by
YiuTerran
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added
ParseWithLayoutsandParseWithFormatsmethods inv2.6.1https://github.com/dromara/carbon?tab=readme-ov-file#parse-a-time-string-as-a-carbon-instance-with-layouts
https://github.com/dromara/carbon?tab=readme-ov-file#-parse-a-time-string-as-a-carbon-instance-with-formats