def get_duration(name, instance):
    """
    Getter for Duration Property field.

    Handles correctly the conversion of of negative running duration (for more refer to the Toggl API doc).
    """
    if instance.is_running:
        return instance.start.int_timestamp * -1
    return int((instance.stop - instance.start).in_seconds())
