{"id":464,"date":"2019-02-04T00:02:48","date_gmt":"2019-02-04T00:02:48","guid":{"rendered":"https:\/\/dapliw.org.ve\/?p=464"},"modified":"2019-02-04T00:02:48","modified_gmt":"2019-02-04T00:02:48","slug":"javascript-formatear-fecha-dd-mm-yyyy","status":"publish","type":"post","link":"https:\/\/saemas.com\/sitio_web\/javascript-formatear-fecha-dd-mm-yyyy\/","title":{"rendered":"Javascript &#8211; Formatear fecha dd\/mm\/yyyy"},"content":{"rendered":"<p>Utilizar la siguiente funci\u00f3n:<\/p>\n<pre>\n&lt;script&gt;\nfunction getFormattedDate(vDate) \n{\n   dateTMP = new Date(vDate);\n   year = dateTMP.getFullYear();\n   month = (1 + dateTMP.getMonth()).toString();\n   month = month.length > 1 ? month : '0' + month;\n   day = dateTMP.getDate().toString();\n   day = day.length > 1 ? day : '0' + day;\n   return day + '\/' + month + '\/' + year;\n}\t\n$(document).ready(function()\n{\n   dateDDMMYY = getFormattedDate(vDate);\n   console.log(dateDDMMYYYY);  \n}); \n&lt;\/script&gt;\n<\/pre>\n<p>\nFuente: <a href=\"https:\/\/stackoverflow.com\/questions\/11591854\/format-date-to-mm-dd-yyyy-in-javascript\" rel=\"noopener noreferrer\" target=\"_blank\">https:\/\/stackoverflow.com\/questions\/11591854\/format-date-to-mm-dd-yyyy-in-javascript<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Utilizar la siguiente funci\u00f3n: &lt;script&gt; function getFormattedDate(vDate) { dateTMP = new Date(vDate); year = dateTMP.getFullYear(); month = (1 + dateTMP.getMonth()).toString(); month = month.length > 1 ? month : &#8216;0&#8217; + month; day = dateTMP.getDate().toString(); day = day.length > 1 ? day : &#8216;0&#8217; + day; return day + &#8216;\/&#8217; + month + &#8216;\/&#8217; + year; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"material-hide-sections":[],"footnotes":""},"categories":[3],"tags":[2],"class_list":["post-464","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-javascript"],"_links":{"self":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/posts\/464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/comments?post=464"}],"version-history":[{"count":0,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/posts\/464\/revisions"}],"wp:attachment":[{"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/media?parent=464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/categories?post=464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/saemas.com\/sitio_web\/wp-json\/wp\/v2\/tags?post=464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}