Y
Yonih
Hey All,
I need some help the following scrip below is used to write the date
however its client side so its pulling the date from the visitors
computer. Does anyone know a way to make it server side so it will get
its date from the server and I don't have to worry about people's
computer date being wrong or manipulating it since it has to do with
prices we will be paying for that date.
<Script type="text/javaScript">
// Get today's current date.
var now = new Date();
// Array list of days.
var days = new Array
('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
// Array list of months.
var months = new Array
('January','February','March','April','May','June','July','August','September','October','November','December');
// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}
// Join it all together
today = months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;
</script>
Display Date
<Script type="text/javaScript"> document.write(today);</script>
Thank you in advanced
Yoni
I need some help the following scrip below is used to write the date
however its client side so its pulling the date from the visitors
computer. Does anyone know a way to make it server side so it will get
its date from the server and I don't have to worry about people's
computer date being wrong or manipulating it since it has to do with
prices we will be paying for that date.
<Script type="text/javaScript">
// Get today's current date.
var now = new Date();
// Array list of days.
var days = new Array
('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
// Array list of months.
var months = new Array
('January','February','March','April','May','June','July','August','September','October','November','December');
// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}
// Join it all together
today = months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;
</script>
Display Date
<Script type="text/javaScript"> document.write(today);</script>
Thank you in advanced
Yoni