the red penguin
HOME ABOUT SITEMAP BLOG LOGIN

Date and time utilities in PHP

To check to see if we have gone past a specific date:

if (new DateTime() > new DateTime("2022-03-09 09:11:00")) {
    # current time is greater than 2010-05-15 16:00:00
    # in other words, 2010-05-15 16:00:00 has passed
}
Wednesday 9 March 2022, 417 views


Leave a Reply

Your email address will not be published. Required fields are marked *