{"id":623,"date":"2023-09-12T07:05:34","date_gmt":"2023-09-12T07:05:34","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2023\/09\/12\/8360107-hostinger-website-builder-how-to-change-the-blog-post-date-format\/"},"modified":"2026-03-16T12:12:02","modified_gmt":"2026-03-16T12:12:02","slug":"8360107-hostinger-website-builder-how-to-change-the-blog-post-date-format","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/8360107-hostinger-website-builder-how-to-change-the-blog-post-date-format\/","title":{"rendered":"Hostinger Website Builder: How to Change the Blog Post Date Format"},"content":{"rendered":"<p class=\"no-margin\">If you use <b>Hostinger Website Builder <\/b>to create a blog and want to <b>change the date format<\/b> for all of your blog posts, follow the steps below &#128071; <\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_12cc404b6c\">Copy the Code<\/h2><pre><code>&lt;script&gt;<br>    function formatDate(date) {<br>        let d = new Date(date.innerText),<br>            month = '' + (d.getMonth() + 1),<br>            day = '' + d.getDate(),<br>            year = d.getFullYear();<br>        if (month.length &lt; 2)<br>            month = '0' + month;<br>        if (day.length &lt; 2)<br>            day = '0' + day;<br>        return [year, month, day + \" \"].join('\/');<br>    }<br>    setInterval(() =&gt; {<br>        if (document.contains(document.querySelector('.block-blog-list')) &amp;&amp; document.querySelector('.block-blog-list-item:last-of-type .blog-list-item-meta__subtitle span:first-of-type').innerHTML.at(-1) !== ' ') {<br>            let randomPosts = document.querySelectorAll('.block-blog-list-item');<br>            randomPosts.forEach(post =&gt; {<br>                post.querySelector('.blog-list-item-meta__subtitle span:first-of-type').innerText = formatDate(post.querySelector('.blog-list-item-meta__subtitle span:first-of-type'));<br>            })<br>        }<br>        if (document.contains(document.querySelector('.block-blog-header')) &amp;&amp; document.querySelector('.blog-list-item-meta__subtitle span:first-of-type').innerHTML.at(-1) !== ' ') {<br>            document.querySelector('.blog-list-item-meta__subtitle span:first-of-type').innerText = formatDate(document.querySelector('.blog-list-item-meta__subtitle span:first-of-type'));<br>        }<br>    }, 500);<br>&lt;\/script&gt;<\/code><\/pre><p class=\"no-margin\">\n<\/p><h2 id=\"h_02a971190f\">Customize the Code<\/h2><p class=\"no-margin\">Depending on your preferred date format, <b>change the arrangement of the values<\/b> here: <\/p><pre><code>return [year, month, day + \" \"].join('\/');<\/code><\/pre><p class=\"no-margin\">The example above would return the date in the following format: <code>yyyy\/mm\/dd<\/code> &#128522; <\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_7a375150a0\">Paste the Code<\/h2><p class=\"no-margin\">Within the builder, go to your website&rsquo;s <b>Settings<\/b> &rarr; <b>Integrations<\/b>, and paste the code in the <b><a href=\"\/support\/6445594-website-builder-how-to-add-custom-code-to-the-head-head-part-of-a-website-s-code\" target=\"_blank\" class=\"intercom-content-link\">Custom code<\/a><\/b> field. Then, <b>save the changes<\/b> and <b>update your website<\/b>.<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">The change will be visible in the preview mode and online; it&rsquo;s not visible in the editor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Changing the date format in a blog post with Hostinger Website Builder<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[282],"tags":[],"class_list":["post-623","post","type-post","status-publish","format-standard","hentry","category-blog"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/8360107-hostinger-website-builder-how-to-change-the-blog-post-date-format\/","default":1},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/8360107-hostinger-criador-de-sites-como-alterar-o-formato-da-data-dos-seus-posts-de-blog\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=623"}],"version-history":[{"count":0,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/623\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}