def get_resource_timestamp(pefile_object):
    """
    Retrieves timestamps from resource directory entries, if available.

    :param pefile.PE pefile_object: pefile object.
    :return: Recovered timestamp from PE resource table entry (if present)
    :rtype: int
    """

    timestamp = 0
    if hasattr(pefile_object, 'DIRECTORY_ENTRY_RESOURCE'):
        resourcedata = pefile_object.DIRECTORY_ENTRY_RESOURCE
        timestamp = getattr(resourcedata.struct, 'TimeDateStamp', 0)
    return timestamp