File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1
1
// For the full copyright and license information, please view the LICENSE
2
2
// file that was distributed with this source code.
3
3
4
+ use std:: env;
5
+
4
6
use chrono:: { DateTime , FixedOffset } ;
5
7
use parse_datetime:: { parse_datetime, parse_datetime_at_date} ;
6
8
7
9
pub fn check_absolute ( input : & str , expected : & str ) {
10
+ env:: set_var ( "TZ" , "UTC0" ) ;
11
+
8
12
let parsed = match parse_datetime ( input) {
9
13
Ok ( v) => v,
10
14
Err ( e) => panic ! ( "Failed to parse date from value '{input}': {e}" ) ,
@@ -18,6 +22,8 @@ pub fn check_absolute(input: &str, expected: &str) {
18
22
}
19
23
20
24
pub fn check_relative ( now : DateTime < FixedOffset > , input : & str , expected : & str ) {
25
+ env:: set_var ( "TZ" , "UTC0" ) ;
26
+
21
27
let parsed = match parse_datetime_at_date ( now. into ( ) , input) {
22
28
Ok ( v) => v,
23
29
Err ( e) => panic ! ( "Failed to parse date from value '{input}': {e}" ) ,
You can’t perform that action at this time.
0 commit comments