mirror of https://github.com/bjdgyc/anylink.git
commit
9e58f3121f
|
@ -43,10 +43,5 @@ func getTimeAgo(days int) string {
|
|||
ts := time.Now().AddDate(0, 0, -days)
|
||||
tsZero := time.Date(ts.Year(), ts.Month(), ts.Day(), 0, 0, 0, 0, time.Local)
|
||||
timeS = tsZero.Format(dbdata.LayoutTimeFormat)
|
||||
// UTC
|
||||
switch base.Cfg.DbType {
|
||||
case "sqlite3", "postgres":
|
||||
timeS = tsZero.UTC().Format(dbdata.LayoutTimeFormat)
|
||||
}
|
||||
return timeS
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ func TestSearchAudit(t *testing.T) {
|
|||
defer closeIpdata()
|
||||
|
||||
currDateVal := "2022-07-24 00:00:00"
|
||||
CreatedAt, _ := time.Parse("2006-01-02 15:04:05", currDateVal)
|
||||
CreatedAt, _ := time.ParseInLocation("2006-01-02 15:04:05", currDateVal, time.Local)
|
||||
|
||||
dataTest := AccessAudit{
|
||||
Username: "Test",
|
||||
|
|
|
@ -199,12 +199,6 @@ func (s *StatsInfo) getScopeDetail(scope string) (sd *ScopeDetail) {
|
|||
}
|
||||
sd.fsTime = sd.sTime.Format(LayoutTimeFormat)
|
||||
sd.feTime = sd.eTime.Format(LayoutTimeFormat)
|
||||
// UTC
|
||||
switch base.Cfg.DbType {
|
||||
case "sqlite3", "postgres":
|
||||
sd.fsTime = sd.sTime.UTC().Format(LayoutTimeFormat)
|
||||
sd.feTime = sd.eTime.UTC().Format(LayoutTimeFormat)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue