timestamps written into the database should really be UTC

This commit is contained in:
2025-10-13 15:31:43 -06:00
parent abd14ea24e
commit 55f5cc5eca
5 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -457,7 +457,7 @@ func hashPassword(password string) string {
func touchUser(user *User) {
user.Mutex.Lock()
defer user.Mutex.Unlock()
moment := time.Now()
moment := time.Now().UTC()
_, _ = amdb.Exec("UPDATE user SET lastaccess = ? WHERE uid = ?", moment, user.Uid)
user.LastAccess = &moment
}
@@ -613,7 +613,7 @@ func AmCreateNewUser(username string, password string, reminder string, dob *tim
// Insert the user record.
_, err2 := amdb.Exec(`INSERT INTO users (username, passhash, verify_email, lockout, email_confnum,
base_lvl, created, lastaccess, passreminder, description, dob) VALUES (?, ?, 0, 0, ?, ?, NOW(), NOW(), ?, '', ?)`,
base_lvl, created, lastaccess, passreminder, description, dob) VALUES (?, ?, 0, 0, ?, ?, UTC_TIMESTAMP(), UTC_TIMESTAMP(), ?, '', ?)`,
username, hashPassword(password), util.GenerateRandomConfirmationNumber(), AmDefaultRole("Global.NewUser").Level(),
reminder, dob)
if err2 != nil {