Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/getTime for timestamp fields, when external signing?Forum ↗

getTime for timestamp fields, when external signing?

App Development2 posts70 viewsLast activity Aug 2025
WA
WallaceKellyOP
Aug 2025

In the docs, the section Where to use getTime, I read…

For workflows that prepare and submit transactions, care needs to be taken when using calls to getTime…

For workflows where this constraint can not be met (e.g. workflows that sign transactions using external parties), it is recommended that workflows are designed to use the ledger time primitives and assertions.

However, that page and the “ledger time primitives and assertions” introduced in 3.x deal with time constraints (e.g, isLedgerTimeGE).

What if I simply want to populate a createdAt field? Can I use getTime? Or do I run the risk of the transaction failing if external signing does not occur within the one-minute window?

Should I populate timestamps like createdAt with an off-ledger time, passed in as a choice argument?

MA
Matteo_Limberto
Aug 2025
WallaceKelly:

What if I simply want to populate a createdAt field? Can I use getTime? Or do I run the risk of the transaction failing if external signing does not occur within the one-minute window?

Yes, I believe the transaction will fail if it falls outside of the one-minute window. This is because getTime is resolved when the transaction is first prepared.

WallaceKelly:

Should I populate timestamps like createdAt with an off-ledger time, passed in as a choice argument?

That’s certainly an option. You can then use the new time primitives to make sure it falls within certain acceptable windows of ledger time.

← Back to Discussions