diff --git a/cm/CHANGES.md b/cm/CHANGES.md index 0c0994287..7aab0b0e4 100644 --- a/cm/CHANGES.md +++ b/cm/CHANGES.md @@ -1,3 +1,6 @@ +## V2.2.0.1 + - added timezone to utils.get_current_date_time to correctly time stamp various experiments! + ## V2.2.0 - fixed detection of a CM artifact using 'cm info .' when inside virtual env entries. - added "cmind.utils.debug_here" function to attach remote Python debugger diff --git a/cm/cmind/__init__.py b/cm/cmind/__init__.py index 1bd8ddb44..f90ca5d96 100644 --- a/cm/cmind/__init__.py +++ b/cm/cmind/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.2.0" +__version__ = "2.2.0.1" from cmind.core import access from cmind.core import error diff --git a/cm/cmind/utils.py b/cm/cmind/utils.py index 21e52952d..e6e4b9b75 100644 --- a/cm/cmind/utils.py +++ b/cm/cmind/utils.py @@ -1215,7 +1215,8 @@ def get_current_date_time(i): Get current date and time. Args: - (CM input dict): empty dict + (CM input dict): + - (timezone) (str): timezone in pytz format: "Europe/Paris" Returns: (CM return dict): @@ -1239,7 +1240,14 @@ def get_current_date_time(i): a = {} - now1 = datetime.datetime.now() + tz = None + + tz_str = i.get('timezone', '').strip() + if tz_str != '': + import pytz + tz = pytz.timezone(tz_str) + + now1 = datetime.datetime.now(tz) now = now1.timetuple() a['date_year'] = now[0]