Skip to content

Commit f93407f

Browse files
authored
Merge pull request #1647 from ydb-platform/utc-to-local
* Returned legacy behaviour for interpret as `time.Time` YDB types `Date`, `Datetime` and `Timestamp`
2 parents 568ae22 + c1196de commit f93407f

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Returned legacy behaviour for interpret as `time.Time` YDB types `Date`, `Datetime` and `Timestamp`
2+
13
## v3.99.9
24
* Fixed broken compatibility `database/sql` driver which worked on query engine (usnig `ydb.WithQueryService(true)` connector option):
35
- fixed list of valid data types for `database/sql.Row.Scan()`

internal/value/any.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ func Any(v Value) (any, error) { //nolint:funlen,gocyclo
4444
case uint32Value:
4545
return uint32(vv), nil
4646
case dateValue:
47-
return DateToTime(uint32(vv)).UTC(), nil
47+
return DateToTime(uint32(vv)), nil
4848
case datetimeValue:
49-
return DatetimeToTime(uint32(vv)).UTC(), nil
49+
return DatetimeToTime(uint32(vv)), nil
5050
case uint64Value:
5151
return uint64(vv), nil
5252
case timestampValue:
53-
return TimestampToTime(uint64(vv)).UTC(), nil
53+
return TimestampToTime(uint64(vv)), nil
5454
case int64Value:
5555
return int64(vv), nil
5656
case intervalValue:

internal/value/any_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ func TestAny(t *testing.T) {
9999
},
100100
{
101101
src: dateValue(123),
102-
exp: time.Unix(int64(123*time.Hour*24/time.Second), 0).UTC(),
102+
exp: time.Unix(int64(123*time.Hour*24/time.Second), 0).Local(),
103103
},
104104
{
105105
src: datetimeValue(123),
106-
exp: time.Unix(int64(123), 0).UTC(),
106+
exp: time.Unix(int64(123), 0).Local(),
107107
},
108108
{
109109
src: timestampValue(123),
110-
exp: time.Unix(0, int64(123*time.Microsecond)).UTC(),
110+
exp: time.Unix(0, int64(123*time.Microsecond)).Local(),
111111
},
112112
{
113113
src: intervalValue(123),

0 commit comments

Comments
 (0)