Improve strftime from ir.lang
The performance can be improved if we avoid database access when the read value is not used. Also the replacement of placeholders by database value should not replace escaped placeholders. And the replacing value must be escaped.