def _timestamps(soup):
    """
    .. versionadded:: 0.3.0

    'Publication' and 'last updated' are two available timestamps.
    If only one timestamp is listed, the story's update and publication time
    should be the same.

    :param soup: Soup containing a page from FanFiction.Net
    :type soup: bs4.BeautifulSoup class

    :returns: Tuple where the first item is the publication time and the second
              item is the update time.
    :rtype: tuple
    """

    metadata_html = soup.find('span', {'class': 'xgray xcontrast_txt'})

    timestamps = metadata_html.find_all(attrs={'data-xutime': True})

    # Logic for dealing with the possibility that only one timestamp exists.
    if len(timestamps) == 1:
        when_updated = timestamps[0]['data-xutime']
        when_published = when_updated
    else:
        when_updated = timestamps[0]['data-xutime']
        when_published = timestamps[1]['data-xutime']

    return when_published, when_updated