mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 05:26:13 +02:00
Convert from local util.get_local_timezone()
to tzlocal.get_localzone()
one side effect is that a `pytz` object is returned rather than a string, and so conversion to a string must be done explicitly at run time where needed.
This commit is contained in:
parent
b77a195f23
commit
623fc076ad
3 changed files with 5 additions and 21 deletions
|
@ -11,6 +11,7 @@ try:
|
|||
from io import StringIO
|
||||
except ImportError:
|
||||
from cStringIO import StringIO
|
||||
import tzlocal
|
||||
|
||||
def _parse_args(command):
|
||||
nargs=[]
|
||||
|
@ -120,7 +121,7 @@ def check_output(context):
|
|||
@then('the output should contain "{text}" in the local time')
|
||||
def check_output_time_inline(context, text):
|
||||
out = context.stdout_capture.getvalue()
|
||||
local_tz = pytz.timezone(util.get_local_timezone())
|
||||
local_tz = tzlocal.get_localzone()
|
||||
utc_time = date_parser.parse(text)
|
||||
date = utc_time + local_tz._utcoffset
|
||||
local_date = date.strftime("%Y-%m-%d %H:%M")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue