'Helper function to parse a string into a date,
time or datetime value (always returns UTC datetimes).
@param dtstr: the string
@param field_type: the field type'

@staticmethod
def _dtparse(dtstr, field_type='datetime'):

    error = None
    value = None
    try:
        dt = s3_decode_iso_datetime(str(dtstr))
        value = s3_utc(dt)
    except:
        error = sys.exc_info()[1]
    if (error is None):
        if (field_type == 'date'):
            value = value.date()
        elif (field_type == 'time'):
            value = value.time()
    return (value, error)
