Alberto Garcia
94fcec7f65
This pr fixes a bug caused when a timestmap in TZ format with milliseconds (`2023-04-05T15:50:48.256816Z` or `2023-04-05T15:50:48.256816+08:00`) is being parsed. - The bug is happens in the function `String2Time` in `convert/time.go` - if the timestamp contains milliseconds a layout with the structure `2006-01-02 15:04:05.` is used to parse it - This layout contains an space between the date and the hour, if the timestamp returned by the db contains a `T` the parser fails and an error is returned This pr adds a check for the `T` and milliseconds in the timestamp, if both conditions are present the date is parsed using the RFC3339 layout Added test cases to check timestamps in this format Solves [#2244](xorm/xorm#2244) Reviewed-on: xorm/xorm#2246 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Alberto Garcia <agarcia@circutor.com> Co-committed-by: Alberto Garcia <agarcia@circutor.com> |
||
---|---|---|
.. | ||
bool.go | ||
conversion.go | ||
float.go | ||
int.go | ||
interface.go | ||
scanner.go | ||
string.go | ||
time_test.go | ||
time.go |