I was looking in a way to get date in ISO format from wikidata and the best way seems to be "{{str sub|{{Data|item=Q79822|property=p569|displayformat=raw}}|1|10}}" using module:Wikidata (same LUA code on Commons and Wikidata). The operation has 2 steps:
- {{Data|item=Q79822|property=p569|displayformat=raw}} returns " 1798-12-24T00:00:00Z"
- {{str sub| 1798-12-24T00:00:00Z|1|10}} trims it to 1798-12-24
The first step uses up 4 expansion depths the second 3. However combined they use up 41 out of 40 expansion depths and trigger "Expansion depth limit exceeded" error.
There might be a better way to get ISO-date from Wikidata (let me know how if you know), but I run into "Expansion depth limit exceeded" error several times while using wikidata returns in Commons templates.
Below is the report on a page with only "{{str sub|{{Data|item=Q79822|property=p569|displayformat=raw}}|1|10}}"
<!--
NewPP limit report
Parsed by mw1219
Cached time: 20160428152934
Cache expiry: 2592000
Dynamic content: false
CPU time usage: 0.535 seconds
Real time usage: 0.548 seconds
Preprocessor visited node count: 229/1000000
Preprocessor generated node count: 0/1500000
Post‐expand include size: 10015/2097152 bytes
Template argument size: 3257/2097152 bytes
Highest expansion depth: 41/40
Expensive parser function count: 1/500
Lua time usage: 0.113/10.000 seconds
Lua memory usage: 4.5 MB/50 MB
Number of Wikibase entities loaded: 0-->
<!--
Transclusion expansion time report (%,ms,calls,template)
877.40% 4800.341 13 - Template:Data
100.00% 547.111 1 - Template:Str_sub
100.00% 547.111 1 - -total
-->