feat: cb message
This commit is contained in:
15
lib/time/time.go
Normal file
15
lib/time/time.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package time
|
||||
|
||||
import "time"
|
||||
|
||||
// 假设 query.StartTime 和 query.EndTime 是 "2006-01-02 15:04:05" 格式字符串
|
||||
func ParseTimeToMicro(ts string) (int64, error) {
|
||||
if ts == "" {
|
||||
return 0, nil
|
||||
}
|
||||
t, err := time.ParseInLocation("2006-01-02 15:04:05", ts, time.Local)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return t.UnixMicro(), nil
|
||||
}
|
||||
Reference in New Issue
Block a user