Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

英文的ParseByFormat和ParseByLayout没有返回值 #56

Closed
180909 opened this issue Apr 13, 2021 · 2 comments
Closed

英文的ParseByFormat和ParseByLayout没有返回值 #56

180909 opened this issue Apr 13, 2021 · 2 comments
Labels
Bug Report a reproducible bug or regression Fixed Bug fixed

Comments

@180909
Copy link
Contributor

180909 commented Apr 13, 2021

代码:
`package main

import (
"fmt"
"github.com/golang-module/carbon"
)

func main() {
fmt.Println(carbon.ParseByFormat("It is 2020-08-05 13:14:15", "It is Y-m-d H:i:s").ToDateString())
fmt.Println(carbon.ParseByLayout("2020|08|05 13|14|15", "2006|01|02 15:04:05").ToDateTimeString())
}`
无任何输出

@gouguoyin
Copy link
Member

fmt.Println(carbon.ParseByLayout("2020|08|05 13|14|15", "2006|01|02 15:04:05").ToDateTimeString())值和模板不对应,应该是fmt.Println(carbon.ParseByLayout("2020|08|05 13|14|15", "2006|01|02 15|04|05").ToDateTimeString())

@gouguoyin
Copy link
Member

mt.Println(carbon.ParseByFormat("It is 2020-08-05 13:14:15", "It is Y-m-d H:i:s").ToDateString())这个确实有点问题,is这两个是特殊字符被解析了,这个bug正在修复,感谢指正。

@gouguoyin gouguoyin added Bug Report a reproducible bug or regression Fixed Bug fixed labels Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report a reproducible bug or regression Fixed Bug fixed
Development

No branches or pull requests

2 participants