{"id":438,"date":"2023-03-22T11:33:42","date_gmt":"2023-03-22T11:33:42","guid":{"rendered":"http:\/\/basicwebsitesolutions.com\/blog\/?p=438"},"modified":"2023-03-22T11:33:44","modified_gmt":"2023-03-22T11:33:44","slug":"php-date-format","status":"publish","type":"post","link":"https:\/\/basicwebsitesolutions.com\/blog\/2023\/03\/22\/php-date-format\/","title":{"rendered":"PHP Date Format"},"content":{"rendered":"\n<p>A common mistake that i always do is to forget the strtotime field<\/p>\n\n\n\n<p>Here is where i usually use it.<\/p>\n\n\n\n<p>Enjoy<\/p>\n\n\n\n<p>Coffee Cup<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\r\n\r\n***************************************************\r\n\r\n\t\/\/20221117\r\n\tif ($pldate != '')\r\n\t{\r\n\t\t$pldate = date(\"m\/d\/Y\", strtotime($pldate));\r\n\t}\r\n\t\r\n\tif ($plcheck_date != '')\r\n\t{\r\n\t\t$plcheck_date = date(\"m\/d\/Y\", strtotime($plcheck_date));\t\r\n\t}\r\n\t\t\t\t\r\n?>\t\r\n        &lt;div id=\"page-wrapper\">\r\n\r\n***************************************************\r\n\r\n$pltype = $_POST['pltype'];\r\n$pltype = htmlspecialchars( $pltype, ENT_QUOTES);\r\n\r\n\t\/\/20160904\r\n\tif ($pldate != '')\r\n\t{\r\n\t\t$pldate = date(\"Y-m-d\", strtotime($pldate));\r\n\t}\r\n\t\r\n\tif ($plcheck_date != '')\r\n\t{\r\n\t\t$plcheck_date = date(\"Y-m-d\", strtotime($plcheck_date));\t\r\n\t\t$plcheck_date2 = date(\"Y-m-d\", strtotime($plcheck_date));\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$plcheck_date2 = NULL;\t\r\n\t}\r\n\r\n***************************************************\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>PHP Date Format <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1,11],"tags":[246,42,247],"class_list":["post-438","post","type-post","status-publish","format-standard","hentry","category-day-to-day-life","category-life-as-a-programmer","category-php-and-mysql","tag-date-format","tag-php","tag-strtotime"],"_links":{"self":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":1,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":439,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/438\/revisions\/439"}],"wp:attachment":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}