How to preserve create time and modification time while importing?

The only way to import creation/modification date information currently is via Drafts native JSON export format. Which looks like:

[
  {
    "created_at" : "2020-02-24T13:45:57Z",
    "tags" : [

    ],
    "accessed_at" : "2020-02-24T13:45:57Z",
    "uuid" : "39EA5821-A1A5-4DE6-AD06-F17381A24D85",
    "folder" : 0,
    "languageGrammar" : "Markdown",
    "created_latitude" : 0.00000,
    "modified_longitude" : 0.00000,
    "content" : "Test Draft",
    "flagged" : false,
    "modified_latitude" : 0.00000,
    "created_longitude" : 0.00000,
    "modified_at" : "2020-02-24T13:46:04Z"
  }
]

If you created this format outside of drafts, named the file with a .draftsExport extension, and import it you would retain the date information.

It not necessarily a bad idea to allow script access to some date values, but no one has ever requested it, and it presents some complexity to avoid the automatic mechanisms for maintaining and updating those values from conflicting with manually set values.

3 Likes