This support ticket is created vor 6 Jahren, 12 Monaten. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
I am using below code in functions.php to set post expiration time, to the last minute/second of the current month:
function func_my_custom_sample_expiration($post_id, $form_data)
{
if (($form_data['id'] == 462) or ($form_data['id']==628)) {
// Modify the automated expiration time to use last minute of last day of current month
// Note that times here are UTC. WordPress then translates to local times.
$new_expiration = mktime(21, 59, 59, date("n"), date("t"));
update_post_meta($post_id, '_cred_post_expiration_time', $new_expiration);
}
}
add_action('cred_save_data', 'func_my_custom_sample_expiration',15,2);
Above code works fine and in the backend in the "Settings for Post Expiration Date", the post expiration shows as December 31, 2017, 23:59 which is correct.
Now, to print expiration date, I use:
[cred-post-expiration id=$active_sample_id format='j F Y, H:i']
It prints December 31, 2017, 21:59 which is wrong as it is two hours earlier.
Also, please note that at my WP General Settings, timezone is set to Athens, which is UTC+2.
This printing of expiration time at two hours difference, looks like a bug to me.
Please check it out.