I am passing a DateTime as a Long into my Apex controller and storing it in a variable called start, and it has a value of:
When I create a DateTime from the Long
DateTime startDateTime = DateTime.newInstance(start); System.debug('startDateTime: ' + startDateTime);
I get the expected output:
startDateTime: 2018-06-06 23:52:10
But when I format it for use in a Dymanic SOQL query like this:
I get a different day and time:
I am using this DateTime to query and the difference in value is leaving out records I am expecting to get.
What am I doing wrong with the DateTime formatting?