尝试将DATETIME值为00:00:00的mysql行更新为新日期。
UPDATE wp_posts SET post_date = FROM_UNIXTIME(UNIX_TIMESTAMP('2011-05-02'))
and post_date_gmt = FROM_UNIXTIME(UNIX_TIMESTAMP('2011-05-02'))
WHERE post_date = 0 LIMIT 100
如果有数千个0
值,则会更新0000-00-00 00:00:00
行。
答案 0 :(得分:1)
UPDATE wp_posts SET post_date = FROM_UNIXTIME(UNIX_TIMESTAMP('2011-05-02')),
post_date_gmt = FROM_UNIXTIME(UNIX_TIMESTAMP('2011-05-02'))
WHERE post_date ="0000-00-00 00:00:00"