def _get_duration_in_seconds(selected_duration):
    """
    Converts hours/minutes to seconds

    Args:
        selected_duration (string): String with number followed by unit
        (e.g. 3 hours, 2 minutes)

    Returns:
        int: duration in seconds
    """
    num_time, num_unit = selected_duration.split(' ')

    if num_unit == 'hours':
        num_time = int(num_time) * 3600
    elif num_unit == 'minutes':
        num_time = int(num_time) * 60

    return int(num_time)