mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 12:30:41 +01:00
feat(sql): use UTC for all dates
This commit is contained in:
parent
018dd93fcb
commit
ffeb65c2ec
@ -30,7 +30,7 @@ func (d *SqlDb) getEvents(q squirrel.SelectBuilder, params db.RetrieveQueryParam
|
||||
}
|
||||
|
||||
func (d *SqlDb) CreateEvent(evt db.Event) (newEvent db.Event, err error) {
|
||||
var created = time.Now()
|
||||
var created = time.Now().UTC()
|
||||
|
||||
_, err = d.exec(
|
||||
"insert into event(user_id, project_id, object_id, object_type, description, created) values (?, ?, ?, ?, ?, ?)",
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
func (d *SqlDb) CreateProject(project db.Project) (newProject db.Project, err error) {
|
||||
project.Created = time.Now()
|
||||
project.Created = time.Now().UTC()
|
||||
|
||||
insertId, err := d.insert(
|
||||
"id",
|
||||
|
@ -12,7 +12,7 @@ func (d *SqlDb) CreateSession(session db.Session) (db.Session, error) {
|
||||
}
|
||||
|
||||
func (d *SqlDb) CreateAPIToken(token db.APIToken) (db.APIToken, error) {
|
||||
token.Created = db.GetParsedTime(time.Now())
|
||||
token.Created = db.GetParsedTime(time.Now().UTC())
|
||||
err := d.sql.Insert(&token)
|
||||
return token, err
|
||||
}
|
||||
@ -56,7 +56,7 @@ func (d *SqlDb) ExpireSession(userID int, sessionID int) error {
|
||||
}
|
||||
|
||||
func (d *SqlDb) TouchSession(userID int, sessionID int) error {
|
||||
_, err := d.exec("update session set last_active=? where id=? and user_id=?", time.Now(), sessionID, userID)
|
||||
_, err := d.exec("update session set last_active=? where id=? and user_id=?", time.Now().UTC(), sessionID, userID)
|
||||
|
||||
return err
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ func (d *SqlDb) CreateTaskOutput(output db.TaskOutput) (db.TaskOutput, error) {
|
||||
"insert into task__output (task_id, task, output, time) VALUES (?, '', ?, ?)",
|
||||
output.TaskID,
|
||||
output.Output,
|
||||
output.Time)
|
||||
output.Time.UTC())
|
||||
return output, err
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ func (d *SqlDb) CreateUserWithoutPassword(user db.User) (newUser db.User, err er
|
||||
}
|
||||
|
||||
user.Password = ""
|
||||
user.Created = db.GetParsedTime(time.Now())
|
||||
user.Created = db.GetParsedTime(time.Now().UTC())
|
||||
|
||||
err = d.sql.Insert(&user)
|
||||
|
||||
@ -42,7 +42,7 @@ func (d *SqlDb) CreateUser(user db.UserWithPwd) (newUser db.User, err error) {
|
||||
}
|
||||
|
||||
user.Password = string(pwdHash)
|
||||
user.Created = db.GetParsedTime(time.Now())
|
||||
user.Created = db.GetParsedTime(time.Now().UTC())
|
||||
|
||||
err = d.sql.Insert(&user.User)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user