0

Please, can anyone tell me how to get current date and time in yang model, i want to apply a must statement in yang which validates that the entered date and time must greater than the current date and time

SidOfc
  • 4,552
  • 3
  • 27
  • 50

1 Answers1

0

There is no XPath function to obtain current time in YANG. From RFC 6020, 6.4.1 XPath Context:

The function library is the core function library defined in XPATH, and a function "current()" that returns a node set with the initial context node.

The core function library contains no such function.

Your requirement is a bit odd. Are you sure you would want to constrain a datastore in such a way? If a value were to be modeled this way in a router config, for example, the operator of this router would have to keep updating this config to make it valid.

Community
  • 1
  • 1
predi
  • 5,528
  • 32
  • 60