import time as _time


class MyTimeService(object):

    def __init__(self, get_time=None):
        self.get_time = get_time or _time.time

def __call__(self):
    return self.get_time()
time = MyTimeService()
How to change the date/time in Python for all modules?