please help me edit this code

  mco 16:32 21 May 2006

...because I'm not quite ready on my own yet... I use this for date and time but I thought I'd like to have a sentence that says just 'welcome to Monday/Tuesday/whichever day it happens to be' (naff, I know, but it's what I want!) Which bits do I cut out of here if I just want the day, please, and where do I write in the 'welcome to' bit? I can figure out how to adjust the size font and colour myself but it's the rest I'm stuck with. Thanks experts. It's here:


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","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write(" small> font color='003366' face='Arial'> b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"  /b> /font> /small>")

/script> span id=tick2>


By George Chiang (WA's JavaScript tutorial)
click here

function show2(){
if (!document.all)

var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="AM"

if (hours>12){

if (hours==0)

if (minutes =9)

if (seconds =9)
var ctime=hours+":"+minutes+":"+seconds+" "+dn
tick2.innerHTML=" b style='font-size:14;color:003366;'>"+ctime+" /b>"


  RicScott 16:58 21 May 2006

I'm not typing it again so goto:

click here

see if it helps you..

  beynac 17:17 21 May 2006

The second script soesn't have the day, so I'm assuming you want the first one to say "Welcome to Sunday".

var mydate=new Date();
var day=mydate.getDay();
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
document.write("<small><font color='003366' face='Arial'><b>Welcome to "+dayarray[day]+"</b> </font> </small>")


NB Some of the tag openers may not show (less than symbol).

  beynac 17:18 21 May 2006

"soesn't" should be "doesn't".

The tags seem OK!

  mco 22:34 21 May 2006

many thanks - will try it!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

HTC U12 Plus review: Hands-on

Frida Kahlo's life, art and legacy explored in Google's new giant online collection and app

Best Android emulators for Mac

Comment importer des contacts d’un iPhone à un autre iPhone ?