We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
carbon version: 1.3.9 or 1.4.2
dataTime := carbon.Now().ToFormatString("Mon, 02 Jan 2006 15:04:05 GMT") fmt.Println(dataTime) output: Julo7, 02 Jpm7 2006 15:04:05 17JulCST
dataTime = time.Now().Format("Mon, 02 Jan 2006 15:04:05 GMT") fmt.Println(dataTime) output: Thu, 22 Jul 2021 17:45:54 GMT
The text was updated successfully, but these errors were encountered:
ToFormatString()方法用错了,该方法支持的格式是Y-m-d H:i:s这样的字符,所有支持的字符请查看格式化符号表 "Mon, 02 Jan 2006 15:04:05 GMT"明显是一个RFC7231格式,可以用carbon.Now().ToRfc7231String()
Sorry, something went wrong.
v1.4.4版本中还可以使用carbon.Now().Layout("Mon, 02 Jan 2006 15:04:05 GMT")
No branches or pull requests
carbon version: 1.3.9 or 1.4.2
dataTime := carbon.Now().ToFormatString("Mon, 02 Jan 2006 15:04:05 GMT")
fmt.Println(dataTime)
output: Julo7, 02 Jpm7 2006 15:04:05 17JulCST
dataTime = time.Now().Format("Mon, 02 Jan 2006 15:04:05 GMT")
fmt.Println(dataTime)
output: Thu, 22 Jul 2021 17:45:54 GMT
The text was updated successfully, but these errors were encountered: