It seems like the epoch format requires the time zone, try this:
@Evaluate(@DateTimeFormat(@DateTimeNow(local),%s))
Also look at the @DateTimeFormat documentation, where it specifically says that %s is rejected for regular datetimes.
It seems like the epoch format requires the time zone, try this:
@Evaluate(@DateTimeFormat(@DateTimeNow(local),%s))
Also look at the @DateTimeFormat documentation, where it specifically says that %s is rejected for regular datetimes.
Thanks David. You're right, it needed a defined zone. Works great now.
I've read the documentation but can you clarify (or point me to) "%s is rejected for regular datetimes"? I don't see that part and understand what it means.
Hi @rqf4v9
please take a look at %s description in
Date/Time Functions > Format String Flags and Examples > @DateTimeFormat. The doc states:
Accepts zoned datetime. Outputs epoch time.
@DateTimeFormat( 19700101000001.234+00:00, %s) = 1.234
@DateTimeFormat( 19700101000001.234, %s) = null
@DateTimeFormat( 19700101000001.234+00:00, %s%z) = null
For unzoned datetime values you could use %Es, however the values will be interpreted as UTC time then.
Thanks David. You're right, it needed a defined zone. Works great now.
I've read the documentation but can you clarify (or point me to) "%s is rejected for regular datetimes"? I don't see that part and understand what it means.
Hi @rqf4v9
please take a look at %s description in
Date/Time Functions > Format String Flags and Examples > @DateTimeFormat. The doc states:
Accepts zoned datetime. Outputs epoch time.
@DateTimeFormat( 19700101000001.234+00:00, %s) = 1.234
@DateTimeFormat( 19700101000001.234, %s) = null
@DateTimeFormat( 19700101000001.234+00:00, %s%z) = null
For unzoned datetime values you could use %Es, however the values will be interpreted as UTC time then.
Thanks David. You're right, it needed a defined zone. Works great now.
I've read the documentation but can you clarify (or point me to) "%s is rejected for regular datetimes"? I don't see that part and understand what it means.
I agree it's not easy to find and it's worded a bit strange... You have to scroll down almost half the page an expand the "@DateTimeFormat" header, where it's documented near the of that section.
My interpretation of that phrase is that %s is rejected as a format flag if the input is a regular datetime, as opposed to a datetime with timezone. Feel free to suggest that Safe make this clearer