I'm trying to get the DateTime field values formatted to example below which is the Developer Console Query editor output.
But when I used String.valueOf(datetimeToConvert) it gives a different format.
Is there a way to get it as a formatted string? without forced formatting? Also I wonder why those right padding zeros, char 'T', etc. Appreciate any help on this conversion. Thanks.