help me write a function to automatically set the end date in 3 months

Closed

Import WP Updated 2 years ago 1 Reply

Konstantin asked 2 years ago on March 18, 2023 at 5:20 pm

help me write a function to automatically set the end date in 3 months

J

James replied Support Agent

2 years ago on March 19, 2023 at 9:42 pm

Hi

I am note sure where you are going to use this function, however here it is, (all it does is returns a date 3 months from now)

function iwphd_set_end_date()
{
    return date('Y-m-d H:i:s', strtotime('+3 months'));
}

To use it:

[iwphd_set_end_date()]