8 Jul
2001
8 Jul
'01
4:58 p.m.
Hi -dev folk.. I ha(d) a problem where DateTime was basing the local timezone on time.tzname, and getting it wrong. (tzname comes from the abbreviation, which in Indiana is 'EST', but DateTime really wants 'US/East-Indiana'. So.. I patched DateTime as follows.. I saw a proposal in the archives about this kind of solution. Any other ideas? How are other folks handling this? thanks, -steve diff DateTime.py myDateTime.py 96,97c96,107 < try: from time import tzname < except: tzname=('UNKNOWN','UNKNOWN') ---
tzname = None try: from localzoneinfo import tzname except: pass
try: if tzname is None: from time import tzname except: tzname=('UNKNOWN','UNKNOWN')