Skip to main content

In PHP I can use ‘U’ format. How do I do this in Arc Script?

So far I’ve got

 

<arc:set attr="expiry">rutcnow() | dateadd('day', 7) | todate('U')]</arc:set>

 

But ‘U’ is not recognised, and I get

Error:

Formatter todate failed in the evaluation of vutcnow()|dateadd('day', 7)|todate('U')]. The error was:Input string was not in a correct format.Value: 2024-02-20T11:07:09+00:00Parameters: U

OKay, I figured it out

<arc:set attr="expiry">[utcnow('U')|dateadd('day', 7)|datediff('second', '1970-01-01')]</arc:set>
 


There is also a “unix” formatter to the now expression:

 

cnow(unix)]

 

This will return the time as epoch


Reply