Forums

Convert UNIXTIME to DATETIME (2 posts)

  1. zxb2
    Member
    Posted 4 years ago #

    Hey, I am importing a DB from a custom CMS to WordPress and I am just stuck on one part - I don't know how to convert UNIXTIME to DATETIME.

    i.e. all the date records in my current DB are like this - 1157070397

    I want to convert them all to the DATETIME format which WordPress uses - 2007-07-21 17:00:19

    Is there a simple query I can run to achieve this? Many thanks :)

  2. zxb2
    Member
    Posted 4 years ago #

    Figured it out :)

    For future reference:

    UPDATE name_of_date_table SET date_field = FROM_UNIXTIME(date_field)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.