Blogger Problem: Undefined Date Issue

Issue:
Date not getting displayed in the webpage.

Solution:
1)Go to Blogger->Blogger Design.


 2)Click on Settings.
3)The following options appear.

4)Click on Timestamp format.


5)Select format: Tuesday, October 06, 2016.



5)Click 'Save'.
6)Go to Template.
7)The below code must be in the template for the time to be displayed in the website.

<script type='text/javascript'>
var timestamp = &quot;<data:post.timestamp/>&quot;;
if (timestamp != &#39;&#39;) {
  var timesplit = timestamp.split(&quot;,&quot;);
  var date_yyyy = timesplit[2];
  var timesplit = timesplit[1].split(&quot; &quot;);
  var date_dd = timesplit[2];
  var date_mmm = timesplit[1].substring(0, 3);
}
</script>

8)Click 'Save Template'.
9)Click 'View Blog' to view the page.
10)Date will get displayed!


Reactions

Post a Comment

2 Comments

  1. Hi, I'm just starting to build my blog. I followed your steps given above but it didn't work for me. The 'undefined' vanished, so as the whole date. Any other ways to show the date? Thanks

    ReplyDelete
    Replies
    1. Hi Mimi, Thanks for commenting. Congratulations on starting your blog. Please recheck the code. Check if any semicolon or brackets are missing because this code solves the problem of undefined date in such an easy way :)

      Delete

Tell me how you felt about this :):)