I wanna convert String date and time to Apex date and time.
2016-12-23T07:26:33+0000 => DateTime Of apex.
How to convert ?
I wanna convert String date and time to Apex date and time.
2016-12-23T07:26:33+0000 => DateTime Of apex.
How to convert ?
I think de-serializing it to a DateTime class should work fine.
System.debug(JSON.deserialize('"2016-12-23T07:26:33+0000"', DateTime.class));
Just make sure that the date is enclosed in double quotes i.e "<DATE>"
Try this one
String dateTimeInString = '2016-12-23T07:26:33+0000';
DateTime acceptableDateTime = DateTime.Valueof(dateTimeInString.replace('T', ' '));