So I'm having some trouble comparing two times, and I wanted to see if someone might be able to assist me:
So I have the following first modified date/time:
Debug::dump($global_post->modified);
Which returns:
string(19) "2022-07-26T18:06:42"
Then I have my second modified time which is this:
$post = static::get_by_corporate_id($global_post->id);
$post_modified_date = $post->get_post_modified();
Which returns:
string(19) "2022-07-26 18:06:41"
Now I'm attempting to utilize the DateTime:diff()
method to compare $global_post->modified
and $post_modified_date
and return true if they match, otherwise, return false.
How would I be able to reliable compare them when they are formatted differently?