def date_gen(self, tz_in=None, tz_out=None):
        # Check parameters and gather tzinfo data (and raise a few exceptions)
        if tz_in is None:
            tz_in = self.default['tz_in']

        if tz_in == "local":
            tz_in = self.local_tz

        tz_in  = self.check_tzparam(tz_in,  'tz_in')
        tz_out = self.check_tzparam(tz_out, 'tz_out')

        # Get timedata
        try:
            dt = tz_in.localize(datetime.now())
        except AttributeError:
            # Fallback for non-pytz timezones ('local')
            dt = datetime.now(tz=tz_in)

        # Process timedata
        # TODO: shift datetime here | split into other function(s)
        if not tz_out:
            return dt

        # Adjust timedata for target timezone
        dt = dt.astimezone(tz_out)
        try:
            return tz_out.normalize(dt)
        except AttributeError:
            # Fallback for non-pytz timezones ('local')
            return dt
Test preprocessing of a create-node request
dataset/ETHPy150Open FichteFoll/InsertDate/format_date/__init__.py/FormatDate.date_gen--crossover with--dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3/s3hierarchy.py/S3HierarchyTests.testPreprocessCreateNode