duanchun1909
duanchun1909
2018-07-13 16:28

在golang中获取日期,例如“ 2018-07-13” [重复]

  • IT行业问题
  • 计算机技术
  • it技术
  • 编程语言问答
  • 互联网问答
已采纳

This question already has an answer here:

how to get date in golang like this formate "2018-07-13"

main.go file

package main

import (
    "fmt"
    "time"
)

func main() {
    fmt.Println(time.Now())
}

$ go run main.go

otuput:

2018-07-13 21:25:16.796379489 +0500 +05 m=+0.000120455

how to write function to return date in string like this formate "2018-07-13"?

</div>
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

为你推荐