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 11// For the full copyright and license information, please view the LICENSE
22// file that was distributed with this source code.
33
4+ use std:: env;
5+
46use chrono:: { DateTime , FixedOffset } ;
57use parse_datetime:: { parse_datetime, parse_datetime_at_date} ;
68
79pub fn check_absolute ( input : & str , expected : & str ) {
10+ env:: set_var ( "TZ" , "UTC0" ) ;
11+
812 let parsed = match parse_datetime ( input) {
913 Ok ( v) => v,
1014 Err ( e) => panic ! ( "Failed to parse date from value '{input}': {e}" ) ,
@@ -18,6 +22,8 @@ pub fn check_absolute(input: &str, expected: &str) {
1822}
1923
2024pub fn check_relative ( now : DateTime < FixedOffset > , input : & str , expected : & str ) {
25+ env:: set_var ( "TZ" , "UTC0" ) ;
26+
2127 let parsed = match parse_datetime_at_date ( now. into ( ) , input) {
2228 Ok ( v) => v,
2329 Err ( e) => panic ! ( "Failed to parse date from value '{input}': {e}" ) ,
You can’t perform that action at this time.
0 commit comments