1

Is there a way to convert the data of a timestamp field into a regular date field in Drupal 8? preferably without coding or making a new module.

  • Don't agree with the close votes on this about being off-topic. It is a clear problem that can be answered. – mpdonadio Jul 11 '18 at 20:58
0

Export/import with Feeds

Feeds module can help to export the existing Timestamp field data and import it into a new Date field.

Feeds Tamper to convert from timestamp to ISO date format

I'm not sure if you can export timestamp into the ISO format directly. If you can't, then you may convert the timestamp to ISO format externally once you have it in a CSV file for example, or you use Feeds Tamper module to convert it during import.

Unix timestamp to Date is on the Feeds Tamper plugin list.

Setting up Feeds can take patience and time, so arm yourself with those, backup everything before starting to meddle with it, and test everything on a local/dev instance. (This always applies, but I find it's good to remind when dealing with Feeds.)

After you have the Date field correctly filled with data, you'll want to delete the Timestamp field.

Delete old Timestamp field

To do that you need to delete the Timestamp data and then the field from your system. You won't be able to delete the field that has some data in it.

To delete the Timestamp data you can use another Feeds import to update the nodes and make that field empty.

You could also delete the data with the help of Views Bulk Operations (VBO) or work directly on the database through some other SQL tool but that is probably out of scope here.

When the Timestamp field is empty you can delete it from your content type through the usual Drupal interface.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.