18
18
19
19
"""
20
20
import datetime
21
- import dateutil
22
21
import numpy as np
23
22
24
23
import matplotlib
@@ -49,7 +48,7 @@ def _reset_epoch_for_tutorial():
49
48
mdates .set_epoch (old_epoch ) # old epoch (pre MPL 3.3)
50
49
51
50
date1 = datetime .datetime (2000 , 1 , 1 , 0 , 10 , 0 , 12 ,
52
- tzinfo = dateutil . tz . gettz ( 'UTC' ) )
51
+ tzinfo = datetime . timezone . utc )
53
52
mdate1 = mdates .date2num (date1 )
54
53
print ('Before Roundtrip: ' , date1 , 'Matplotlib date:' , mdate1 )
55
54
date2 = mdates .num2date (mdate1 )
@@ -60,7 +59,7 @@ def _reset_epoch_for_tutorial():
60
59
# dates closer to the old epoch:
61
60
62
61
date1 = datetime .datetime (10 , 1 , 1 , 0 , 10 , 0 , 12 ,
63
- tzinfo = dateutil . tz . gettz ( 'UTC' ) )
62
+ tzinfo = datetime . timezone . utc )
64
63
mdate1 = mdates .date2num (date1 )
65
64
print ('Before Roundtrip: ' , date1 , 'Matplotlib date:' , mdate1 )
66
65
date2 = mdates .num2date (mdate1 )
@@ -85,7 +84,7 @@ def _reset_epoch_for_tutorial():
85
84
mdates .set_epoch (new_epoch )
86
85
87
86
date1 = datetime .datetime (2020 , 1 , 1 , 0 , 10 , 0 , 12 ,
88
- tzinfo = dateutil . tz . gettz ( 'UTC' ) )
87
+ tzinfo = datetime . timezone . utc )
89
88
mdate1 = mdates .date2num (date1 )
90
89
print ('Before Roundtrip: ' , date1 , 'Matplotlib date:' , mdate1 )
91
90
date2 = mdates .num2date (mdate1 )
0 commit comments