POST TIME:2020-04-11 14:37
dedecms如何批量修改文章發布時間。
1、首先是SQL語句:
update dede_archives set pubdate= 1308240000 where id>=1 and id<=10;
update dede_archives set senddate= 1405382400 where id>=1 and id<=10;
解釋一下上面兩行代碼,功能就是把ID號從1到10的文章發布日期由2011年6月17日修改到2014年7月15日。
其中“pubdate= 1308240000 ”和“senddate= 1405382400” 中的數字為“Unix時間(Unixtimestamp) ” 這個把日期轉換成時間戳的地址,可以使用php的
strtotime("2014-07-15 18:25:20");來實現,這里不要忘了php中需要設置時區
date_default_timezone_set('Asia/Shanghai');否則與北京時間會有時差。
或者使用在線工具獲得Unix時間戳:http://tool.chinaz.com/Tools/unixtime.aspx
2、執行SQL命令:
后臺->系統->SQL命令行工具