{"id":5125,"date":"2025-09-26T10:05:00","date_gmt":"2025-09-26T09:05:00","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=5125"},"modified":"2026-02-26T16:04:29","modified_gmt":"2026-02-26T16:04:29","slug":"date-and-time-adjust","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/date-and-time\/date-and-time-adjust","title":{"rendered":"Date And Time Adjust"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Adjusting Date Time Values<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  $AdjustedTime = gmdate('Y-m-d H:i:s',strtotime('+1 hour +30 minute +45 second',strtotime($MyDateTime)));\n\n  $AdjustedTime = gmdate('Y-m-d H:i:s',strtotime('+1 hour',strtotime($MyDateTime)));\n\n  $AdjustedTime = gmdate('Y-m-d H:i:s',strtotime('-1 hour',strtotime($MyDateTime)));\n\n  $AdjustedTime = gmdate('Y-m-d H:i:s',strtotime(\"-$MyVariable minutes\",strtotime($MyDateTime)));<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>  $MyDateTimeString = \"2015\/03\/02\";  \n  $MyDateTime = strtotime($MyDateTimeString);\n  $MyDateTime = strtotime(\"+7 day\", $MyDateTime);<\/code><\/pre>\n\n\n\n<p>Values:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>week<\/li>\n\n\n\n<li>day<\/li>\n\n\n\n<li>hour<\/li>\n\n\n\n<li>minute<\/li>\n\n\n\n<li>second<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Add # to current Server Time<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>    $ServerTimeNow = db_read_server_time();\n    $DeleteFilesAfterMins = date('Y-m-d H:i:s', strtotime('+' . DELETE_UNUSED_OPERATION_AFTER_MINS . ' minute', strtotime($ServerTimeNow)));<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Adjusting Date Time Values Values: Add # to current Server Time<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-5125","post","type-post","status-publish","format-standard","hentry","category-date-and-time"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=5125"}],"version-history":[{"count":5,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5125\/revisions"}],"predecessor-version":[{"id":5300,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/5125\/revisions\/5300"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=5125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=5125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=5125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}