You can use javascript to do this easily. Drop this code in your page (add it to the template in default.aspx, or add it to the output of a custom webpart).
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from old browsers
var Today = new Date();
var month;
switch (Today.getMonth()) {
case 0:
month = "January";
break;
case 1:
month = "February";
break;
case 2:
month = "March";
break;
case 3:
month = "April";
break;
case 4:
month = "May";
break;
case 5:
month = "June";
break;
case 6:
month = "July";
break;
case 7:
month = "August";
break;
case 8:
month = "September";
break;
case 9:
month = "October";
break;
case 10:
month = "November";
break;
case 11:
month = "December";
break;
}
GuitarMike -
Thanks for the tip. It worked, but I need the date to be displayed in the following format: Wednesday, July 28, 2004. How can I change the format of the displayed date? For example, change the font and color. Also, I need a code to diplay the current time.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.