SQL Bulk modified Empire CMS article release time (requires Unix time, otherwise it will become 1970-01-01)

Source: Internet
Author: User

When migrating a website, sometimes we need to change the Empire CMS post time batch to the current time, in the Empire CMS background → system settings → backup and restore data → Execute SQL statement:

Update phome_ecms_news Set newstime = ' 2014-07-03 ';

(Ps:phome This is the default database table prefix, if you create the database when there are other settings can be modified by itself)

So after executing the SQL statement and refreshing all the articles, you will find that the time has changed to 1970-01-01, because the newstime type is int (10) and must be a Unix timestamp, so we must first convert the current time to Unix time, such as 2014-07-04 15:52:43 conversion to Unix time is 1404460363, so we need to re-modify the SQL statement

Update phome_ecms_news Set newstime = ' 1404460363 ';

The result of the execution is this.

You also refresh the article to see if the time is normal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.