Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
更新系统时间接口
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhuozhuo committed Sep 28, 2023
1 parent 71b937b commit 1a98c7a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions controllers/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ func (c *HomeController) List() {
// 系统时间
func (this *HomeController) SystemTime() {
format := "2006-01-02 15:04:05"
now := time.Now().Format(format)
now := time.Now()
nowStr := now.Format(format)
var data = make(map[string]interface{})
data["systime"] = now
data["systime"] = nowStr
//毫秒
data["timestamp"] = now.UnixNano() / 1e6
response.SuccessWithDetailed(200, "success", data, map[string]string{}, (*context2.Context)(this.Ctx))
return
}
Expand Down

0 comments on commit 1a98c7a

Please sign in to comment.