For Kinesis, it seems to be, that AWS organizes its folders on S3 like: "prefix/2019/02/09/13/kinesis-stream-name-2019-02-09-10-02-32-db1db7a9-c484-40d1-b7ec-7651a55e4677"

The date in the path is UTC-time, the date in the file name is the UTC-time of the first received byte in the Kinesis stream for the specific file. This is the default behavior, so it would be nice to implement it in localstack.
if is_alpine():
        
        return run('cp -r %s %s' % (source, target))
    shutil.copytree(source, target)
def rm_dir(dir):
    if is_alpine():
        
        return run('rm -r %s' % (dir))
    shutil.rmtree(dir)
def create_lambda_archive(script, get_content=False, libs=[], runtime=None, file_name=None):
    """ Utility method to create a Lambda function archive """
    runtime = runtime or LAMBDA_DEFAULT_RUNTIME
    tmp_dir = tempfile.mkdtemp(prefix=ARCHIVE_DIR_PREFIX)
    TMP_FILES.append(tmp_dir)
    file_name = file_name or get_handler_file_from_name(LAMBDA_DEFAULT_HANDLER, runtime=runtime)
    script_file = os.path.join(tmp_dir, file_name)
    if os.path.sep in script_file:
        mkdir(os.path.dirname(script_file))
        
        path = file_name.split(os.path.sep)
        for i in range(1, len(path)):
            save_file(os.path.join(tmp_dir, *(path[:i] + ['__init__.py'])), '')
    save_file(script_file, script)