It鈥檚 currently not possible to format dates into unix timestamps. The following outputs something else entirely.
dateCreated@formatDateTime(format: "U")
Under the hood, the date format U (or php:U) appears to be converted to an empty string before being formatted.
A possible solution would be to reuse this code from asDate before the PHP to ICU reformat that I mention above in asDatetime.
Thanks, @brandonkelly. 馃憤
Would definitely be worthwhile amending the docs for this too, if you鈥檝e not already.
Which docs?
https://craftcms.com/docs/3.x/graphql.html#list-of-available-directives
The format description should probably mention the php: prefix and reference the expected value format(s).
Ah, right. Just updated that for the next release: e8e8cadd02cf391d2c0b32f18040cbbd4539ef3d
Craft 3.5.6 is out now with that fix.