Author Topic: How to Add Dates in Webpages?  (Read 217 times)

0 Members and 1 Guest are viewing this topic.

Offline Corps

  • Sr. Member
  • *
  • Posts: 282
  • Karma: +0/-0
    • View Profile
How to Add Dates in Webpages?
« on: October 25, 2008, 07:54:27 AM »
JavaScript code will add the current date (based on the user’s system date/time) to any webpage:

Code: [Select]
  var mydate=new Date()
  var year=mydate.getYear()
  if (year < 1000)
    var day=mydate.getDay()
    var month=mydate.getMonth()
    var daym=mydate.getDate()
  if (daym<10)
    var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday",
    var montharray=new Array("January","February","March","April",
  document.write("<small><font color=\'000000\' face=\'Arial\'>"
                +dayarray[day]+", "+montharray[month]+" "+daym+",

Techronnati | where technology never sleeps

How to Add Dates in Webpages?
« on: October 25, 2008, 07:54:27 AM »

Mountain View


Related Topics

  Subject / Started by Replies Last post
0 Replies
Last post April 02, 2009, 06:42:14 AM
by CyborgRepublic
3 Replies
Last post September 10, 2014, 08:02:09 AM
by CyborgRepublic
1 Replies
Last post October 28, 2016, 02:59:40 AM
by JusticeLeague

Posting Disclaimer: Any individual may post a message in this forum and may do so anonymously. Therefore, the sole author is exclusively and entirely responsible for all opinions in that message. They do not represent the official opinions of Techronnati, its administrators or moderators or the Techronnati Management. Techronnati is merely acting as an impartial conduit for constitutionally protected free speech and is not responsible and will not be held liable for the content of such messages. All images and service logos are trademarks of their respective owners.