answersLogoWhite

0

i have tried the following

<script type="text/javascript">

var curtime = new Date(),

curday = curtime.getDate(),

curmonth = curtime.getMonth()+1;

if (currentmonth 14)

window.location = "homevlntns.html";

if (currentmonth 31)

window.location = "homehllwn.html";

if (currentmonth 25)

window.location = "homexmas.html";

else window.location = "error.html";

</script>

but no luck.

User Avatar

Wiki User

10y ago

What else can I help you with?

Continue Learning about Engineering

How to display current date in html using javascript?

You can't do it in HTML, but you can in javascript or PHP, which can be added to an HTML document. Just add the code to where you want it to display the time. &lt;?PHP print(Date("l F d, Y")); ?&gt; &lt;script type="text/javascript"&gt; &lt;!-- document.write(Date()); --&gt; &lt;/script&gt;


What is the date of Maharashtra DEd CET exam?

ded new gr PRE 2006i(4767)/PRA SHI-1 Date-16 DEC 2009


How do you define a constructor function for a Date class that initializes the Date objects?

The following is one possible method. If the input arguments would result in an invalid date (or no arguments are given), then the members are set to an arbitrary default date (in this case 1/1/1980). An alternative method that ensures all dates are valid (non-default) would be to throw an exception from the set() member. If your code is producing invalid date arguments (causing the exception to be thrown) then you really need to fix the code that generates those dates. Note that the static methods, is_valid() and is_leap_year(), can be used to check date arguments without actually constructing a date object. Another alternative would be to set a flag that denotes if the date object is valid or not. However, this is the least intuitive method as the onus is then placed upon the user to always check the flag before using the object. #include&lt;iostream&gt; #include&lt;iomanip&gt; class cdate { unsigned m_day; unsigned m_month; unsigned m_year; public: cdate (unsigned day, unsigned month, unsigned year): m_day(1), m_month(1), m_year(1980) { set (day, month, year); } cdate (const cdate&amp; date): m_day(date.m_day), m_month(date.m_month), m_year(date.m_year) {} cdate&amp; operator= (const cdate&amp; date) { m_day=date.m_day; m_month=date.m_month; m_year=date.m_year; } bool set (unsigned day, unsigned month, unsigned year); static bool is_valid (unsigned day, unsigned month, unsigned year); static bool is_leap_year (unsigned year); unsigned day() const { return m_day; } unsigned month() const { return m_month; } unsigned year() const { return m_year; } }; bool cdate::is_valid (unsigned day, unsigned month, unsigned year) { // handle zeroes if (!day !month !year) return false; // handle invalid month if (month&gt;12) return false; // handle 31 day months if ((month==1 month==3 month==5 month==7 month==8 month==10 month==12) &amp;&amp; day&gt;31) return false; // handle 30 day months if ((month==4 month==6 month==9 month==11) &amp;&amp; day&gt;30) return false; // handle leap years if (month==2) { if (!is_leap_year (year) &amp;&amp; day&gt;28) return false; else if (day&gt;29) return false; } // data ok return true; } bool cdate::is_leap_year(unsigned year) { // common year (not divisible by 4) if (year%4) return false; // leap year (not divisible by 100) else if (year%100) return true; // leap year (divisible by 400) else if (year%400==0) return true; // common year return false; } bool cdate::set (unsigned day, unsigned month, unsigned year) { if (is_valid (day, month, year)) { m_day = day; m_month = month; m_year = year; return true; } // alternatively, throw an exception here return false; } std::ostream&amp; operator&lt;&lt; (std::ostream&amp; os, const cdate&amp; date) { os &lt;&lt; std::setw (2) &lt;&lt; std::setfill('0') &lt;&lt; date.day() &lt;&lt; '/' &lt;&lt; std::setw (2) &lt;&lt; std::setfill('0') &lt;&lt; date.month() &lt;&lt; '/' &lt;&lt; std::setw (4) &lt;&lt; std::setfill('0') &lt;&lt; date.year(); return os; } int main () { // invalid date (was not a leap year) std::cout &lt;&lt; "Input:\t29/02/1900" &lt;&lt; std::endl; cdate d1(29,2,1900); std::cout &lt;&lt; "Output:\t" &lt;&lt; d1 &lt;&lt; std::endl; // valid date (was a leap year) std::cout &lt;&lt; "Input:\t29/02/2000" &lt;&lt; std::endl; cdate d2(29,2,2000); std::cout &lt;&lt; "Output:\t" &lt;&lt; d2 &lt;&lt; std::endl; }


How to upgrade to a javascript capable browser to register for Facebook?

Just go to one of the related links and download the executable file for your OS, and run it on your computer. The you'll have an up-to-date, JavaScript capable browser.


Can you give me an example a program of turbo c that determine a zodiac sign?

#include &lt;stdio.h&gt; int main() { int month,date; printf("Enter the month and date of your birth in the format mm-dd:\n"); scanf("%d-%d",&amp;month,&amp;date); if(month&lt;1month&gt;12date&lt;1date&gt;31) { printf("That is not a valid date.\n"); return 1; } printf("Your zodiac sign is "); switch(month) { case 1: if (date&lt;20) printf("Capricorn\n"); else printf("Aquarius\n"); break; case 2: if (date&lt;19) printf("Aquarius\n"); else printf("Pisces\n"); break; case 3: if (date&lt;21) printf("Pisces\n"); else printf("Aries\n"); break; case 4: if (date&lt;20) printf("Aries\n"); else printf("Taurus\n"); break; case 5: if (date&lt;21) printf("Taurus\n"); else printf("Gemini\n"); break; case 6: if (date&lt;21) printf("Gemini\n"); else printf("Cancer\n"); break; case 7: if (date&lt;23) printf("Cancer\n"); else printf("Leo\n"); break; case 8: if (date&lt;23) printf("Leo\n"); else printf("Virgo\n"); break; case 9: if (date&lt;23) printf("Virgo\n"); else printf("Libra\n"); break; case 10: if (date&lt;23) printf("Libra\n"); else printf("Scorpio\n"); break; case 11: if (date&lt;22) printf("Scorpio\n"); else printf("Sagittarius\n"); break; case 12: if (date&lt;22) printf("Sagittarius\n"); else printf("Capricorn\n"); break; } return 0; }

Related Questions

If I have a month-to-month apartment and I am moving out halfway through a month will they scale down my rent based on my move out date?

Most landlords won't, and they certainly don't have to.


What is January's secondary birthstone?

Birthstones are based off of the month of birth, not the date of birth; therefore, the birthstone for the month of January is garnet.


What is October's 2 birthstones?

Birthstones are based off of the month of birth, not the date of birth; therefore, the birthstones for the month of Octoberare tourmaline and opal.


What is Punjabi month date is today?

what is date of punjabi month


What is date today of Punjabi month?

what is date of punjabi month


What is the birthstone for October 27th?

Birthstones are based off of the month of birth, not the date of birth; therefore, the birthstones for the month of Octoberare tourmaline and opal.


How do you write month year and date in french?

Month: Mois Year: Ann&eacute;e Date: date


Insert date on a webpage using javascript?

Just use new Date(); to get the current date and then use document.getElementById to insert it on the webpage. &lt;div id="example"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; document.getElementById('example') = new Date(); &lt;/script&gt;


What are the examples of Java script?

validation of forms, date &amp; time.


How do you count months: by weeks or by date?

Months are typically counted by date, based on the calendar system. Each month has a specific number of days, and the date is used to determine the passage of time within a month. Weeks are not commonly used to count months, as months do not have a consistent number of weeks.


How is the date for Ramadan determined each year?

The date for Ramadan is determined each year based on the sighting of the new moon, following the Islamic lunar calendar. This method is used to establish the start of the month of Ramadan, which is the ninth month of the Islamic calendar.


Who is your date this month?

There is no date this month of mine because i am going with my papers which are realy tough.