The following lines
new_variable = dataset['Time'].units[14:].rstrip()
print ("NEW VARIABLE ", new_variable, type(new_variable), len(new_variable))
datetime_variable = datetime.datetime.strptime(new_variable, '%y-%m-%d %H:%M:%S')
produces the following output
NEW VARIABLE 2025-02-07 00:00:00 <class 'str'> 19
but generates the following error
datetime_variable = datetime.strptime(new_variable, '%y-%m-%d %H:%M:%S')
File "/usr/lib/python3.10/_strptime.py", line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
File "/usr/lib/python3.10/_strptime.py", line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2025-02-07 00:00:00' does not match format '%y-%m-%d %H:%M:%S'
I really don't understand why datetime complains about the string format or how to fix it.