While trying to retrieve the headers from an integration response, I am getting a Datetime value in String format in the Header.
Format - Mon, 01 Jul 2019 10:20:06 GMT I need to compare this with the lastmodifieddate of Account.
Code :
String strDate = headers.get('Date');
DateTime lastmodified = DateTime.valueOfGmt(strDate);
String utcDt = lastmodified.format('yyyy-mm-dd', 'UTC');
system.debug('!===lastmodified : '+lastmodified);