Browse Source

增加具体日期转时间戳函数

master v0.3.0
lijianbin 2 years ago
parent
commit
7128e60789
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      time.go

+ 1
- 2
time.go View File

@ -1,7 +1,6 @@
package helper
import (
"git.tetele.net/tgo/helper"
"strconv"
"time"
)
@ -85,7 +84,7 @@ func RFC3339ToCSTLayout(value string) (string, error) {
func DatetimeToUnix(value string) int64 {
loc, _ := time.LoadLocation("Asia/Shanghai")
reserveTime, _ := time.ParseInLocation("2006-01-02 15:04:05", helper.ToStr(value), loc)
reserveTime, _ := time.ParseInLocation("2006-01-02 15:04:05", value, loc)
return reserveTime.Unix()
}

Loading…
Cancel
Save