From f137144bc787058b9d096935df2913bb372374dd Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Sat, 10 May 2014 14:02:05 +0200 Subject: [PATCH] Reset on every call of Datetime print function the format to default --- sickbeard/sbdatetime.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sickbeard/sbdatetime.py b/sickbeard/sbdatetime.py index 7b20fb10..b7af2d32 100644 --- a/sickbeard/sbdatetime.py +++ b/sickbeard/sbdatetime.py @@ -99,6 +99,11 @@ class sbdatetime(datetime.datetime): @static_or_instance def sbftime(self, dt=None, show_seconds=False, t_preset=None): + try: + locale.setlocale(locale.LC_TIME, '') + except: + pass + try: if sbdatetime.has_locale: locale.setlocale(locale.LC_TIME, 'us_US') @@ -133,6 +138,11 @@ class sbdatetime(datetime.datetime): @static_or_instance def sbfdate(self, dt=None, d_preset=None): + try: + locale.setlocale(locale.LC_TIME, '') + except: + pass + strd = '' try: if self is None: @@ -153,6 +163,11 @@ class sbdatetime(datetime.datetime): @static_or_instance def sbfdatetime(self, dt=None, show_seconds=False, d_preset=None, t_preset=None): + try: + locale.setlocale(locale.LC_TIME, '') + except: + pass + strd = '' try: if self is None: