@@ -25,7 +25,7 @@ func Test_TruncateTime(t *testing.T) {
25
25
name : "truncate to 1s" ,
26
26
time : & ottl.StandardTimeGetter [any ]{
27
27
Getter : func (ctx context.Context , tCtx any ) (any , error ) {
28
- return time .Date (2022 , 1 , 1 , 1 , 1 , 1 , 999999999 , time .Local ), nil
28
+ return time .Date (2022 , 1 , 1 , 1 , 1 , 1 , 999999999 , time .UTC ), nil
29
29
},
30
30
},
31
31
duration : & ottl.StandardDurationGetter [any ]{
@@ -34,13 +34,13 @@ func Test_TruncateTime(t *testing.T) {
34
34
return d , nil
35
35
},
36
36
},
37
- expected : time .Date (2022 , 1 , 1 , 1 , 1 , 1 , 0 , time .Local ),
37
+ expected : time .Date (2022 , 1 , 1 , 1 , 1 , 1 , 0 , time .UTC ),
38
38
},
39
39
{
40
40
name : "truncate to 1ms" ,
41
41
time : & ottl.StandardTimeGetter [any ]{
42
42
Getter : func (ctx context.Context , tCtx any ) (any , error ) {
43
- return time .Date (2022 , 1 , 1 , 1 , 1 , 1 , 999999999 , time .Local ), nil
43
+ return time .Date (2022 , 1 , 1 , 1 , 1 , 1 , 999999999 , time .UTC ), nil
44
44
},
45
45
},
46
46
duration : & ottl.StandardDurationGetter [any ]{
@@ -49,13 +49,13 @@ func Test_TruncateTime(t *testing.T) {
49
49
return d , nil
50
50
},
51
51
},
52
- expected : time .Date (2022 , 1 , 1 , 1 , 1 , 1 , 999000000 , time .Local ),
52
+ expected : time .Date (2022 , 1 , 1 , 1 , 1 , 1 , 999000000 , time .UTC ),
53
53
},
54
54
{
55
55
name : "truncate old time" ,
56
56
time : & ottl.StandardTimeGetter [any ]{
57
57
Getter : func (ctx context.Context , tCtx any ) (any , error ) {
58
- return time .Date (1980 , 9 , 9 , 9 , 59 , 59 , 999999999 , time .Local ), nil
58
+ return time .Date (1980 , 9 , 9 , 9 , 59 , 59 , 999999999 , time .UTC ), nil
59
59
},
60
60
},
61
61
duration : & ottl.StandardDurationGetter [any ]{
@@ -64,7 +64,7 @@ func Test_TruncateTime(t *testing.T) {
64
64
return d , nil
65
65
},
66
66
},
67
- expected : time .Date (1980 , 9 , 9 , 9 , 0 , 0 , 0 , time .Local ),
67
+ expected : time .Date (1980 , 9 , 9 , 9 , 0 , 0 , 0 , time .UTC ),
68
68
},
69
69
}
70
70
for _ , tt := range tests {
0 commit comments