About this question
Using Apex, how can I format a Datetime variable the same way it is displayed in SOQL results? It seems that SOQL uses the UTC format. When I run the following query
SELECT Created Date FROM Account
I get the following datetime format:
2017-01-10T14:53:55.000+0000