If you want to do this temporarily that means you want to be able to switch back later, right? That in turn means you don’t want to change the values in the database. So you want the_time
to change after it has retrieved the value from the database, but before it is presented to the user. Luckily the_time
has a filter for that. Like this
add_filter ('the_time','wpse303207_change_year');
function wpse303207_change_year ($time) {
// do your thing
}
Because the_time
returns a string that depends on the time format you have chosen, you’ll have to sort out yourself how to use str_replace
to change the date inside the time string.
This would also work for the_date
, by the way.