GetTimeWithFsp gets the time value with given fsp
(fsp int)
| 247 | |
| 248 | // GetTimeWithFsp gets the time value with given fsp |
| 249 | func (bj BinaryJSON) GetTimeWithFsp(fsp int) Time { |
| 250 | coreTime := CoreTime(bj.GetUint64()) |
| 251 | |
| 252 | tp := mysql.TypeDate |
| 253 | if bj.TypeCode == JSONTypeCodeDatetime { |
| 254 | tp = mysql.TypeDatetime |
| 255 | } else if bj.TypeCode == JSONTypeCodeTimestamp { |
| 256 | tp = mysql.TypeTimestamp |
| 257 | } |
| 258 | |
| 259 | return NewTime(coreTime, tp, fsp) |
| 260 | } |
| 261 | |
| 262 | // GetDuration gets the duration value |
| 263 | func (bj BinaryJSON) GetDuration() Duration { |
no test coverage detected