How to set the NETCONF STREAM event time format

Hi Team,

Currently I am using CONFD version 6.3 and I would like to change the event time format for the notifications in the NETCONF stream.

Currently event time format is with off set of +00.00 which I need to change to “Z”
Could any one please help

Thanks,
Amarnath

Hi,

I believe you cannot change/configure the eventTime format for the RFC5277 NETCONF stream that ConfD provide built-in support for.
https://tools.ietf.org/html/rfc5277#section-2.2.1

Both
2017-02-13T10:00:00+01:00
and
2017-02-13T09:00:00Z
complies with RFC3339, so NETCONF clients should be able to support both formats.
https://tools.ietf.org/html/rfc3339#section-4.2

Hi Conhult,

I understand but there is a statement about notable exceptions in ietf-yang-types yang model for date-and-time

" © The canonical format (see below) of data-and-time values
differs from the canonical format used by the dateTime XML
schema type, which requires all times to be in UTC using the
time-offset ‘Z’."

How we could address this?
One of our NETCONF client is strictly expecting Z in case “offset” is defined in canonical format of +00:00

Thanks,
Amarnath

Hi,

I understand the issue, and ConfD could be made to allow notification timestamps to be configurable to allow clients who only follow the NETCONF standard partially to function.
But it would make most sense if the client added support for full compliance of RFC6991 so that the NETCONF servers it communicates with doesn’t have to be bloated with code to allow clients that do not bother to implement the standard to still function.

Yes, and that exception states that ietf-yang-types.yang RFC6991 does not follow the canonical format requirements in section 3.2.7.2 “Canonical representation” of XML Schema Part 2: Datatypes Second Edition

The pattern regular expression included with the date-and-time definition in RFC6991 describes it all:
pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?' + '(Z|[\+\-]\d{2}:\d{2})';

Full text from RFC 6991 - Common YANG Data Types

typedef date-and-time {
       type string {
         pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
               + '(Z|[\+\-]\d{2}:\d{2})';
       }
       description
        "The date-and-time type is a profile of the ISO 8601
         standard for representation of dates and times using the
         Gregorian calendar.  The profile is defined by the
         date-time production in Section 5.6 of RFC 3339.
         The date-and-time type is compatible with the dateTime XML
         schema type with the following notable exceptions:
         (a) The date-and-time type does not allow negative years.
         (b) The date-and-time time-offset -00:00 indicates an unknown
             time zone (see RFC 3339) while -00:00 and +00:00 and Z
             all represent the same time zone in dateTime.
         (c) The canonical format (see below) of data-and-time values
             differs from the canonical format used by the dateTime XML
             schema type, which requires all times to be in UTC using
             the time-offset 'Z'.
         This type is not equivalent to the DateAndTime textual
         convention of the SMIv2 since RFC 3339 uses a different
         separator between full-date and full-time and provides
         higher resolution of time-secfrac.
         The canonical format for date-and-time values with a known time
         zone uses a numeric time zone offset that is calculated using
         the device's configured known offset to UTC time.  A change of
         the device's offset to UTC time will cause date-and-time values
         to change accordingly.  Such changes might happen periodically
         in case a server follows automatically daylight saving time
         (DST) time zone offset changes.  The canonical format for
         date-and-time values with an unknown time zone (usually
         referring to the notion of local time) uses the time-offset
         -00:00.";
       reference
        "RFC 3339: Date and Time on the Internet: Timestamps
         RFC 2579: Textual Conventions for SMIv2
         XSD-TYPES: XML Schema Part 2: Datatypes Second Edition";
     }