Minor changes to get running in Python 3.13.

This commit is contained in:
Matt
2026-01-20 22:04:28 -06:00
parent bf2d101d63
commit 7f5bf50fac
3 changed files with 38 additions and 18 deletions

View File

@@ -18,8 +18,9 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
import datetime as dt
import pytz
#import pytz
from tzlocal import get_localzone
from zoneinfo import ZoneInfo
import threading
@@ -47,12 +48,18 @@ class arElement():
self._arTz = v
def arGetLocalTime(self):
ldt = self._arLtz.localize(dt.datetime.now())
naive_dt = dt.datetime.now()
#print(naive_dt)
#aware_dt = naive_dt.replace(tzinfo=ZoneInfo('America/Chicago'))
ldt = naive_dt.replace(tzinfo=self._arLtz)
#ldt = self._arLtz.localize(dt.datetime.now())
return ldt.astimezone(self._arTz)
def arGetUTCTime(self):
ldt = self._arLtz.localize(dt.datetime.now())
return ldt.astimezone(pytz.utc)
#ldt = self._arLtz.localize(dt.datetime.now())
naive_dt = dt.datetime.now()
ldt = naive_dt.replace(tzinfo=self._arLtz)
return ldt.astimezone("Etc/UTC")
def arPrint(self, message):
self._arPrintLock.acquire()