JAVASCRIPT: What's the date?

WRITING THE ACTUAL DATE

Want to get a visitor to order by a certain date or she doesn’t get the bonuses? Here’s the script. Place it wherever you want the display. (BODY)

Order Before
 

// Specify names of days: 
var dayNames = new Array(“Sunday”,”Monday”,”Tuesday”,
“Wednesday”, “Thursday”,”Friday”,”Saturday”); 

// Specify names of months: 
var monthNames = new Array(“January”,”February”,”March”,”April”,”May”,”June”,
“July”, “August”,”September”,”October”,
“November”,”December”); 

var now = new Date(); 
var thisday = dayNames[now.getDay() +2]; 
var thismonth = monthNames[now.getMonth()]; 
var thisdate = now.getDate(); 
var thisdate=thisdate + 2; 
var thisyear = now.getFullYear(); 

document.write(thisday + “, ” + thismonth + ” ” 
+ thisdate + “, ” + thisyear); 

// –> 
 
and Get 6 Bonuses FREE!

And here are more formats for writing the dates

display dates formats

dd/mm/yy


var date = new Date();
var d = date.getDate();
var day = (d
var m = date.getMonth() + 1;
var month = (m
var yy = date.getYear();
var year = (yy

document.write(day + “/” + month + “/” + year);
//–>
date month year


function makeArray() {
for (i = 0; i
this[i + 1] = makeArray.arguments[i];
}

var months = new makeArray(‘January’,’February’,’March’,
‘April’,’May’,’June’,’July’,’August’,’September’,
‘October’,’November’,’December’);

var date = new Date();
var day = date.getDate();
var month = date.getMonth() + 1;
var yy = date.getYear();
var year = (yy

document.write(day + ” ” + months[month] + ” ” + year);
//–>

Advertisements