YTSFlix_Go/vendor/github.com/anacrolix/missinggo/sqlite.go

18 lines
296 B
Go
Raw Normal View History

2018-11-04 14:58:15 +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
}