detect date to select css style sheet

J

Jorntk

how can i use javascript to detect the current date to select css style
sheet so that the color style of the site is different every day like
wired.com?
 
S

Shawn Milo

Jorntk said:
how can i use javascript to detect the current date to select css style
sheet so that the color style of the site is different every day like
wired.com?

It seems that you could do something simple like:

var dToday = new Date;

That will create a variable containing the current date/time.

You can then use one of the following:

dToday.getMonth()
dToday.getDate()
dToday.getDay()

You can then select a stylesheet by day of week, day of month, or month,
depending upon your preference.

Shawn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top