def compare_last_pagetoken_time(
        self, checkpoint_data, checkpoint_obj, hash_file_state_manager_obj
    ):
        """Compare last page token time with current time.

        Args:
            checkpoint_data (dict): checkpoint data
            checkpoint_obj (StateManager): The StateManager object to post checkpoint data to.
            hash_file_state_manager_obj (StateManager): The StateManager object to retrieve hash checkpoint data.

        Returns:
            checkpoint_data (dict): checkpoint data
        """
        __method_name = inspect.currentframe().f_code.co_name
        try:
            if checkpoint_data:
                last_page_token_time = checkpoint_data.get("date")
                if (
                    last_page_token_time
                    and datetime.datetime.utcnow()
                    - datetime.datetime.fromisoformat(last_page_token_time)
                    >= datetime.timedelta(hours=consts.CHECKPOINT_RESET_TIME)
                ):
                    applogger.info(
                        self.log_format.format(
                            consts.LOGS_STARTS_WITH,
                            __method_name,
                            self.azure_function_name,
                            "Last date time more than 12 hours old, so resetting checkpoints",
                        )
                    )
                    checkpoint_data = {}
                    self.post_checkpoint_data(checkpoint_obj, checkpoint_data)
                    self.post_checkpoint_data(
                        hash_file_state_manager_obj, checkpoint_data
                    )
                    return True
            return False
        except Exception as err:
            applogger.error(
                self.log_format.format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    self.azure_function_name,
                    consts.UNEXPECTED_ERROR_MSG.format(err),
                )
            )
            raise MimecastException()
Compare last page token time with current time.

        Args:
            checkpoint_data (dict): checkpoint data
            checkpoint_obj (StateManager): The StateManager object to post checkpoint data to.
            hash_file_state_manager_obj (StateManager): The StateManager object to retrieve hash checkpoint data.

        Returns:
            checkpoint_data (dict): checkpoint data
        
Solutions/Mimecast/Data Connectors/MimecastAT/SharedCode/utils.py