如果你想暂时这样做,那就意味着你想稍后切换回来,对吗?这反过来意味着您不想更改数据库中的值。所以你想要the_time 在从数据库检索到值之后,但在将其呈现给用户之前进行更改。幸运的是the_time 有一个过滤器。像这样
add_filter (\'the_time\',\'wpse303207_change_year\');
function wpse303207_change_year ($time) {
   // do your thing
   }
 因为
the_time 返回一个字符串,该字符串取决于
time format 您已经选择了,您必须自己解决如何使用
str_replace 更改时间字符串内的日期。
这也适用于the_date, 顺便说一句