Bugfix: global name 'localtime' is not defined