<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!--  Author: www.cgiscript.net  -->

<!-- Begin

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array('diumenge','dilluns','dimarts','dimecres','dijous','divendres','dissabte');

// Array list of months.
var months = new Array('gener','febrer','març','abril','maig','juny','juliol','agost','setembre','octubre','novembre','desembre');

// Calculate the number of the current day in the week.
var date        = now.getDate();
var hour        = now.getHours();
var minute      = now.getMinutes();
var second      = now.getSeconds();

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
								}

// Join it all together
setmana = days[now.getDay()] + ", ";
if ( now.getMonth() + 1 == 4 || now.getMonth() + 1 == 8 || now.getMonth() + 1  == 10  )
{ dia = date;
  mes = " d'" + months[now.getMonth()] + " de " }
else
{ dia = date  + " de ";  
  mes = months[now.getMonth()] + " de " }
any = (fourdigits(now.getYear())) + "," ;
if (minute < 10){
minut = hour + ":0" + minute;
}
else {
minut = hour + ":" + minute;
};
// Print out the data.
document.write(setmana);
document.write(dia);
document.write('<br>');
document.write(mes);
document.write(any);
document.write('<br>');
document.write('a les ');
document.write(minut);
//  End -->