diff --git a/os/gtime/gtime_sql.go b/os/gtime/gtime_sql.go new file mode 100644 index 000000000..142448d98 --- /dev/null +++ b/os/gtime/gtime_sql.go @@ -0,0 +1,17 @@ +package gtime + +import ( + "database/sql/driver" +) + +//add Scanner +func (t *Time) Scan(value interface{}) error { + newTime := New(value) + t.Time = newTime.Time + return nil +} + +//add valuer +func (t *Time) Value() (driver.Value, error) { + return t.Time, nil +}