mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Reorg
This commit is contained in:
21
pkg/models/sqlite_timestamp.go
Normal file
21
pkg/models/sqlite_timestamp.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"time"
|
||||
)
|
||||
|
||||
type SQLiteTimestamp struct {
|
||||
Timestamp time.Time
|
||||
}
|
||||
|
||||
// Scan implements the Scanner interface.
|
||||
func (t *SQLiteTimestamp) Scan(value interface{}) error {
|
||||
t.Timestamp = value.(time.Time)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Value implements the driver Valuer interface.
|
||||
func (t SQLiteTimestamp) Value() (driver.Value, error) {
|
||||
return t.Timestamp.Format(time.RFC3339), nil
|
||||
}
|
||||
Reference in New Issue
Block a user