YTSFlix_Go/vendor/github.com/anacrolix/missinggo/sqlite.go
2018-11-04 15:58:15 +01:00

18 lines
296 B
Go

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
}