@@ -438,19 +438,19 @@ func TestSelect(t *testing.T) {
438
438
{"'abc'" , string ("abc" )},
439
439
{"cast(null as varchar(3))" , nil },
440
440
{"NULL" , nil },
441
- {"cast('1753-01-01' as datetime)" , time .Date (1753 , 1 , 1 , 0 , 0 , 0 , 0 , time .UTC )},
442
- {"cast('2000-01-01' as datetime)" , time .Date (2000 , 1 , 1 , 0 , 0 , 0 , 0 , time .UTC )},
441
+ {"cast('1753-01-01' as datetime)" , time .Date (1753 , 1 , 1 , 0 , 0 , 0 , 0 , time .Local )},
442
+ {"cast('2000-01-01' as datetime)" , time .Date (2000 , 1 , 1 , 0 , 0 , 0 , 0 , time .Local )},
443
443
{"cast('2000-01-01T12:13:14.12' as datetime)" ,
444
- time .Date (2000 , 1 , 1 , 12 , 13 , 14 , 120000000 , time .UTC )},
445
- {"cast('2014-06-26 11:08:09.673' as datetime)" , time .Date (2014 , 06 , 26 , 11 , 8 , 9 , 673000000 , time .UTC )},
446
- {"cast('9999-12-31T23:59:59.996' as datetime)" , time .Date (9999 , 12 , 31 , 23 , 59 , 59 , 996000000 , time .UTC )},
444
+ time .Date (2000 , 1 , 1 , 12 , 13 , 14 , 120000000 , time .Local )},
445
+ {"cast('2014-06-26 11:08:09.673' as datetime)" , time .Date (2014 , 06 , 26 , 11 , 8 , 9 , 673000000 , time .Local )},
446
+ {"cast('9999-12-31T23:59:59.996' as datetime)" , time .Date (9999 , 12 , 31 , 23 , 59 , 59 , 996000000 , time .Local )},
447
447
{"cast(NULL as datetime)" , nil },
448
448
{"cast('1900-01-01T00:00:00' as smalldatetime)" ,
449
- time .Date (1900 , 1 , 1 , 0 , 0 , 0 , 0 , time .UTC )},
449
+ time .Date (1900 , 1 , 1 , 0 , 0 , 0 , 0 , time .Local )},
450
450
{"cast('2000-01-01T12:13:00' as smalldatetime)" ,
451
- time .Date (2000 , 1 , 1 , 12 , 13 , 0 , 0 , time .UTC )},
451
+ time .Date (2000 , 1 , 1 , 12 , 13 , 0 , 0 , time .Local )},
452
452
{"cast('2079-06-06T23:59:00' as smalldatetime)" ,
453
- time .Date (2079 , 6 , 6 , 23 , 59 , 0 , 0 , time .UTC )},
453
+ time .Date (2079 , 6 , 6 , 23 , 59 , 0 , 0 , time .Local )},
454
454
{"cast(NULL as smalldatetime)" , nil },
455
455
{"cast(0x1234 as varbinary(2))" , []byte {0x12 , 0x34 }},
456
456
{"cast(null as unitext)" , nil },
@@ -849,15 +849,13 @@ func TestDateTimeParam(t *testing.T) {
849
849
t .Fatal ("create table failed" )
850
850
}
851
851
852
- var emptydate time.Time
853
- mindate := time .Date (1 , 1 , 1 , 0 , 0 , 0 , 0 , time .UTC )
854
- maxdate := time .Date (9999 , 12 , 31 , 23 , 59 , 59 , 999999900 , time .UTC )
852
+ mindate := time .Date (1 , 1 , 1 , 0 , 0 , 0 , 0 , time .Local )
853
+ maxdate := time .Date (9999 , 12 , 31 , 23 , 59 , 59 , 999999900 , time .Local )
855
854
values := []testStruct {
856
- {time .Date (1969 , time .July , 20 , 20 , 18 , 0 , 0 , time .UTC )}, // First man on the Moon
857
- {time .Date (1970 , 1 , 1 , 0 , 0 , 0 , 0 , time .UTC )}, // UNIX date
858
- {time .Date (4 , 6 , 3 , 12 , 13 , 14 , 150000000 , time .UTC )}, // some random date
855
+ {time .Date (1969 , time .July , 20 , 20 , 18 , 0 , 0 , time .Local )}, // First man on the Moon
856
+ {time .Date (1970 , 1 , 1 , 0 , 0 , 0 , 0 , time .Local )}, // UNIX date
857
+ {time .Date (4 , 6 , 3 , 12 , 13 , 14 , 150000000 , time .Local )}, // some random date
859
858
{mindate }, // minimal value
860
- {emptydate },
861
859
}
862
860
for _ , test := range values {
863
861
t .Run (fmt .Sprintf ("Test for %v" , test .t ), func (t * testing.T ) {
0 commit comments