{"id":56030,"date":"2022-06-07T03:01:20","date_gmt":"2022-06-06T17:01:20","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=56030"},"modified":"2022-06-07T07:42:07","modified_gmt":"2022-06-06T21:42:07","slug":"php-date-difference-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-date-difference-primer-tutorial\/","title":{"rendered":"PHP Date Difference Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/away_off.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP Date Difference Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/away_off.jpg\" title=\"PHP Date Difference Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">PHP Date Difference Primer Tutorial<\/p><\/div>\n<p>When you think of Timezones, do you think of datetime differences?<\/p>\n<p>Okay, well <i>some<\/i> people must <font size=1>&#8230; surely?<\/font>  Anyway, we do.  We wonder, thinking about other people in the wooooorrrrllllddd, what time is it for them?  Even, what day is it for them, the International Dateline blowing my tiny little mooooiiinnnnddd!<\/p>\n<p>And so we wrote some PHP code to help with <i>datetime differences<\/i> whether they be related to Timezones or not.  We designed a PHP web application that always starts with a defined &#8220;Start Datetime&#8221; and then allows either &#8230;<\/p>\n<ol>\n<li>End Datetime (deriving Datetime Difference) &#8230; or &#8230;<\/li>\n<li>Datetime Difference (deriving End Datetime)<\/li>\n<\/ol>\n<p> &#8230; modes of use.  Simple, huh?!  And yet, even here, with that first scenario, a pretty fundamental thing was learnt, by yours truly, undertaking this exercise.  A <i>Datetime Difference<\/i> result is only useful to the &#8220;Day&#8221; point because any one &#8220;Month&#8221; can be a different length of time to another, and so, becomes difficult to express in terms of a &#8220;Month Difference&#8221;.<\/p>\n<p>Feel free to try our <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/away_off.php_GETME\">&#8220;proof of concept&#8221;<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/away_off.php\">PHP web application<\/a>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d56030' onclick='var dv=document.getElementById(\"d56030\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/date\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d56030' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>When you think of Timezones, do you think of datetime differences? Okay, well some people must &#8230; surely? Anyway, we do. We wonder, thinking about other people in the wooooorrrrllllddd, what time is it for them? Even, what day is &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-date-difference-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[2078,301,3988,2139,367,452,587,849,932,3989,1986,1279,1693,1319],"class_list":["post-56030","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-constructor","tag-date","tag-date-difference","tag-difference","tag-dropdown","tag-form","tag-iframe","tag-object","tag-php","tag-programmming","tag-proof-of-concept","tag-time","tag-timezone","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/56030"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=56030"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/56030\/revisions"}],"predecessor-version":[{"id":56034,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/56030\/revisions\/56034"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=56030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=56030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=56030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}