def absolute_date(resolution, start, end, last_seen=False):
    """Select an absolute date range for a location selector.

    :keyword resolution: Time resolution specifier, e.g. ``hours`` or ``days``.
    :keyword start: UTC start time in ISO 8601 format.
    :keyword end: UTC end time in ISO 8601 format.
    :keyword last_seen: Select only devices last seen in this location.
        Defaults to False.

    >>> from pprint import pprint
    >>> d = absolute_date(resolution='months', start='2013-01', end='2013-06')
    >>> pprint(d)
    {'months': {'end': '2013-06', 'start': '2013-01'}}
    >>> d = absolute_date(resolution='minutes', start='2012-01-01 12:00',
    ...         end='2012-01-01 12:45', last_seen=True)
    >>> pprint(d, width=76)
    {'last_seen': True,
     'minutes': {'end': '2012-01-01 12:45', 'start': '2012-01-01 12:00'}}

    """
    if resolution not in 'minuteshoursdaysweeksmonthsyears':
        raise ValueError('Invalid date resolution: %s' % resolution)
    payload = {resolution: {'start': start, 'end': end}}
    if last_seen:
        payload['last_seen'] = True
    return payload
