{"id":1789,"date":"2017-11-15T14:57:09","date_gmt":"2017-11-15T14:57:09","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=1789"},"modified":"2022-02-17T07:14:02","modified_gmt":"2022-02-17T07:14:02","slug":"date-input-fields","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/html\/forms-html\/date-input-fields","title":{"rendered":"Date input fields"},"content":{"rendered":"\n<p>Supported by some HTML5&nbsp;browsers which will display a date picker <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$CopyToUsbFromDate = date('Y-m-d', strtotime(\"-2 day\", strtotime(date(\"Y-m-d H:i:s\")))); \/\/Get current date -2 days\n\/\/$CopyToUsbFromDate = date('Y-m-d'); \/\/Get current date\n\n&lt;input type=\"date\" name=\"FromDate\" value=\"$CopyToUsbFromDate\"><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">datetime db field from date picker<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">When handling form submission<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>  \/\/Set datetime from date field\n  $AdvertCreated = mysqli_real_escape_string($dblink, $_POST&#91;'AdvertCreated']);\n  $AdvertCreated = date(\"Y-m-d\", strtotime($AdvertCreated)) . \"T00:00:00\";<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">In the form<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>  &lt;p>\n  &lt;label>AdvertCreated:&lt;\/label>\n  &lt;input type=\"date\" name=\"AdvertCreated\" value=\"&lt;?php echo($AdvertCreated);?>\">\n  &lt;\/p><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Supported by some HTML5&nbsp;browsers which will display a date picker datetime db field from date picker When handling form submission In the form<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44],"tags":[],"class_list":["post-1789","post","type-post","status-publish","format-standard","hentry","category-forms-html"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1789","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=1789"}],"version-history":[{"count":3,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1789\/revisions"}],"predecessor-version":[{"id":2931,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/1789\/revisions\/2931"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=1789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=1789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=1789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}