1

How do you get the current time in pact? I couldn't find it in the documentation

https://pact-language.readthedocs.io/en/stable/pact-functions.html?highlight=time#time-2

Kitty Kad
  • 412
  • 1
  • 7

1 Answers1

1

Found the answer -

It can be found under the block-time variable under chain-data documentation

Example:

pact> (chain-data)
{"block-height": 0,"block-time": "1970-01-01T00:00:00Z",
"chain-id": "","gas-limit": 0,"gas-price": 0.0,
"prev-block-hash": "","sender": ""}
Kitty Kad
  • 412
  • 1
  • 7