status-go/vendor/github.com/anacrolix/missinggo/sqlite.go

18 lines
296 B
Go
Raw Normal View History

2022-03-10 09:44:48 +00:00
package missinggo
import (
"database/sql"
"time"
)
type SqliteTime time.Time
var _ sql.Scanner = (*SqliteTime)(nil)
func (me *SqliteTime) Scan(src interface{}) error {
var tt time.Time
tt, err := time.Parse("2006-01-02 15:04:05", string(src.([]byte)))
*me = SqliteTime(tt)
return err
}