Skip to content

Commit 10b5976

Browse files
author
XieBiao
committed
timestamp convert time str
1 parent 759de17 commit 10b5976

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package main
22

33
import (
4-
"fmt"
4+
"github.com/hhxsv5/go-db-proxy-api"
55
"github.com/hhxsv5/go-db-proxy-api/examples/models/mydefault"
6+
"fmt"
67
"io"
7-
"github.com/hhxsv5/go-db-proxy-api"
88
"net/http"
99
"time"
1010
)
@@ -27,7 +27,7 @@ func main() {
2727
for i, u := range users {
2828
it = time.Unix(u.InsertTime, 0)
2929
mt = time.Unix(u.ModifyTime, 0)
30-
rsp += fmt.Sprintf("%d: %d, %s, %s, %s\n", i, u.Id, u.Cellphone, it.Format("2006-01-02 15:04:05"), mt.Format("2006-01-02 15:04:05"))
30+
rsp += fmt.Sprintf("%d: %d, %s, %s, %s\n", i, u.Id, u.Cellphone, it.Format(time.RFC3339), mt.Format("2006-01-02 15:04:05"))
3131
}
3232

3333
io.WriteString(w, rsp)

0 commit comments

Comments
 (0)