Created Date and Last Modified Date fields in Salesforce objects are audit fields and we can’t edit or change these field directly or through code. You have to contact salesforce support team for them to grant permissions to you to edit or change these fields if needed.
Just create a case through salesforce help for getting the permission to edit these fields. Once salesforce support team grants the access for editing these fields then perform following steps :
1. Open the org.
2. Click on setup.
3. Type user interface in searching box as shown below and click on User interface :
4. Check “Enable “Set Audit Fields upon Record Creation” and “Update Records with Inactive Owners” User Permissions” checkboxes and click on save as shown in image below :
5. Again type permission sets in search box or profiles.
Check boxes of “Set Audit Fields upon Record Creation” and “Update Records with Inactive Owners” :
Now you will be able to change values of Created Date and Last Modified Date fields.