diff --git a/gcalcli/argparsers.py b/gcalcli/argparsers.py index 023a338e..b170c92d 100644 --- a/gcalcli/argparsers.py +++ b/gcalcli/argparsers.py @@ -62,6 +62,7 @@ 'given', }, '--locale': {'default': '', 'type': str, 'help': 'System locale'}, + '--timezone': {'default': '', 'type': str, 'help': 'Timezone to use'}, '--refresh': { 'action': 'store_true', 'dest': 'refresh_cache', diff --git a/gcalcli/cli.py b/gcalcli/cli.py index 5f7ad1da..924fe024 100755 --- a/gcalcli/cli.py +++ b/gcalcli/cli.py @@ -37,6 +37,7 @@ import re import signal import sys +import time from argparse import ArgumentTypeError from collections import namedtuple @@ -226,6 +227,10 @@ def main(): except ValueError as exc: printer.err_msg(str(exc)) + if parsed_args.timezone: + os.environ['TZ'] = parsed_args.timezone + time.tzset() + cal_names = set_resolved_calendars(parsed_args, printer=printer) userless_mode = bool(os.environ.get('GCALCLI_USERLESS_MODE'))