title: Identify String Value is Date or DateTime field in Apex Salesforce
body: <p>Working on Salesforce. I have Transaction-1 and Transaction-2 object which has master detailed relationship with the Case Object. Dynamically query is getting created, it's executing on the database and Results coming like below.</p>
  
  <p>This is sample result for Case:</p>
  
  <blockquote>
    <p>({Id=500c000000B1LYCAA3, CaseNumber__c=RPQ-00001231,CreatedById=005c000UUUU, LastModifiedDate=2018-01-02 12:56:03, LastModifiedById=005c000UUUU, OwnerId=005c000UUUU, Category__c=Payment, SubCategory__c=Chase Paymentech, Origin=Email, CreatedDate=2018-01-01 15:22:14, Status=Pending, ContactId=003c000})</p>
  </blockquote>
  
  <p>All the Date and DateTime fields I need to format based on the logged in users Locale. Mostly dd-MM-yyyy.</p>
  
  <pre><code>List&lt;Sobject&gt; s = Database.query(queryStr);
  </code></pre>
  
  <p>s has all above result. How to identify all Date and DateTime fields ? Do I need to iterate over it and used RegEx to identify Date or Date/Time fields ?</p>