Avatar billede guldklumpen Nybegynder
02. marts 2004 - 10:04 Der er 7 kommentarer og
2 løsninger

Hjælp til dato - tirsdag 2. marts 2004

Jeg skal have sat dato ind.

Datoen skal automatisk ændre sig hver dag og der skal stå følgende:

f.eks. "tirsdag den 2. marts 2004".

Hvordan gør jeg det ?

Håber der er nogle genier der kan hjælpe
Avatar billede Slawomir Seniormester
02. marts 2004 - 10:10 #1
kan du bruge js?
Avatar billede guldklumpen Nybegynder
02. marts 2004 - 10:11 #2
hvis det virker så er det helt fint.
Avatar billede Slawomir Seniormester
02. marts 2004 - 10:12 #3
øjeblik
Avatar billede fennec Nybegynder
02. marts 2004 - 10:18 #4
ASP:
Response.write WeekdayName(day(date())) & " " & DatePart("d",date()) & " " & MonthName(month(date())) & " " & DatePart("yyyy",date())
Avatar billede Slawomir Seniormester
02. marts 2004 - 10:19 #5
her

<body>

<script>

/*Current date script credit:
JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/

var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
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='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</b></font></small>")

</script>

<p align="center"><font face="arial, helvetica" size="-2">This free script provided by</font><br>
<font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
Kit</a></font></p>

</body>

//burgerking
Avatar billede Slawomir Seniormester
02. marts 2004 - 10:24 #6
eller oversæt til dansk

<script>

/*Current date script credit:
JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/

var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("søndag","mandag","tirsdag","onsdag","torsdag","fridag","lørdag")
var montharray=new Array("januar","februar","marts","april","maj","juni","juli","august","september","october","november","december")
document.write("<small><font color='000000' face='Arial'><b>"+dayarray[day]+" "+daym+". "+montharray[month]+" "+year+"</b></font></small>")

</script>

<p align="center"><font face="arial, helvetica" size="-2">This free script provided by</font><br>
<font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
Kit</a></font></p>

//BK
Avatar billede guldklumpen Nybegynder
02. marts 2004 - 10:28 #7
Det var lige det jeg havde brug for.

Tak for hjælpen.
Avatar billede Slawomir Seniormester
02. marts 2004 - 10:30 #8
ellers har du et andet eksempel her

<SCRIPT LANGUAGE=Javascript>
<!--
/*
Java Script Calendar is a small script for web pages which displays current Day of the week, Month, Date and Year along with Holidays notification. Just like this working demo below. It will work with Netscape 2++, Microsoft 3++ and Opera 3++ web browsers.

                                    Tuesday, November 24, 1998   

About 70 holidays from all over the world are displayed by Calendar (if you know other ones, let me know, I will add them). It even calculates Easter Sunday date! To see how it works change the date on your computer to January, 1,
for example and re-load the page.

Installation is very simple. Just copy the script below, everything between SCRIPT and SCRIPT tags (including tags themselves) and paste in the place you want it to appear on your page. You can customize the way
it looks by changing document.write function arguments just after month names definitions. Java Script Calendar is free without any limitations. Copyright © Eugene Vassiltsov. But please, let me know if you will use it.
*/

calendar = new Date();
day = calendar.getDay();
month = calendar.getMonth();
date = calendar.getDate();
year = calendar.getYear();
if (year < 1000)
year+=1900
cent = parseInt(year/100);
g = year % 19;
k = parseInt((cent - 17)/25);
i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
l = i - j;
emonth = 3 + parseInt((l + 40)/44);
edate = l + 28 - 31*parseInt((emonth/4));
emonth--;
var dayname = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var monthname =
new Array ("January","February","March","April","May","June","July","August","September","October","November","December" );
document.write("<font face=verdana,arial size=2>");
document.write(dayname[day] + ", ");
document.write(monthname[month] + " ");
if (date< 10) document.write("0" + date + ", ");
        else document.write(date + ", ");
document.write(year + "    <font color=FF0000>");
// Easter
if ((month == emonth) && (date == edate)) document.write("Easter Sunday (Western)  ");
// January
if ((month == 0) && (date == 1)) document.write("New Year's Day");
if ((month == 0) && (date == 15)) document.write("Adults Day (Japan)");
if ((month == 0) && (date == 27)) document.write("Wolfgang Amadeus Mozart born (1756)");
if ((month == 0) && (day == 1) && (date > 14) && (date< 22)) document.write("Martin Luther King's Birthday");
// February
if ((month == 1) && (date == 2)) document.write("Groundhog Day");
if ((month == 1) && (date == 8)) document.write("Jules Verne born (1828)");
if ((month == 1) && (date == 11)) document.write("National Foundation Day (Japan)");
if ((month == 1) && (date== 12)) document.write("Lincoln's Birthday");
if((month == 1) && (date == 14)) document.write("St. Valentine's Day");
if ((month == 1) && (date == 15)) document.write("Galileo Galilei born (1564)");
if ((month == 1) && (date == 22)) document.write("Washington's Birthday");
if ((month == 1) && (date == 29)) document.write("Leap Day");
// March
if ((month == 2) && (date == 3)) document.write("Girl's Day (Japan)");
if ((month == 2) && (date == 17)) document.write("St. Patrick's Day");
if ((month == 2) && (date == 21)) document.write("J.S. Bach born (1685)");
// April
if ((month == 3) && (date == 1)) document.write("April Fools' Day");
if ((month == 3) && (date == 8)) document.write("Buddha born");
if ((month == 3) && (date == 15) && (day != 0)) document.write("Income Tax Day (USA),  ");
if ((month == 3) && (date == 16) && (day == 1)) document.write("Income Tax Day (USA) ");
if ((month == 3) && (date == 15)) document.write("Leonardo da Vinci born (1452)");
if ((month == 3) && (date == 22)) document.write("Earth Day");
if ((month == 3) && (date == 29)) document.write("Emperor's Birthday (Japan)");
if ((month == 3) && (day == 0) && (date > 0) && (date< 8)) document.write("Daylight Savings Time Begins");
// May
if ((month == 4) && (date == 1)) document.write("May Day,  Boy's Day (Japan)");
if ((month == 4) && (date == 2)) document.write("Constitution Day (Japan)");
if ((month == 4) && (date == 5)) document.write("Cinco de Mayo (Mexico),  Children's Day (Japan)");
if ((month == 4) && (date == 14)) document.write("Independence Day (Paraguay)");
if ((month == 4) && (day == 0) && (date > 7) && (date< 16)) document.write("Mother's Day");
if ((month == 4) && (day == 1) && (date > 24)) document.write("Memorial Day");
// June
if ((month == 5) && (date == 5)) document.write("Constitution Day (Denmark)");
if ((month == 5) && (date == 6)) document.write("D-Day (USA)");
if ((month == 5) && (date == 11)) document.write("Kamehameha (Hawaii)");
if ((month == 5) && (date == 14)) document.write("FlagDay (USA)");
if ((month == 5) && (date == 21)) document.write("Summer Solstice");
if((month == 5) && (date == 24)) document.write("St. Jean Baptiste Day (Canada)");
if ((month == 5) && (date == 30)) document.write("Independence Day (Zaire)");
if ((month == 5) && (day == 0) && (date > 15) && (date< 24)) document.write("Father's Day");
// July
if ((month == 6) && (date == 1)) document.write("Independence Day (Canada)");
if ((month == 6) && (date == 4)) document.write("Independence Day (USA)");
if ((month == 6) && (date == 14)) document.write("Bastille Day (France)");
// August
if ((month == 7) && (date == 1)) document.write("Confederation Day (Switzerland)");
if ((month == 7) && (date == 10)) document.write("Independence Day (Ecuador)");
if ((month == 7) && (date == 15)) document.write("Independence Day (India)");
// September
if ((month == 8) && (date == 7)) document.write("Independence Day (Brazil)");
if ((month == 8) && (date == 15)) document.write("Respect for the Aged Day (Japan)");
if ((month == 8) && (date == 16)) document.write("Independence Day (Mexico)");
if ((month == 8) && (day== 1)&& (date > 0) && (date< 8)) document.write("Labor Day (USA)");
// October
if ((month == 9) && (date == 1)) document.write("German Reunufication (1990)");
if ((month == 9) && (date == 10)) document.write("Health-Sports Day (Japan)");
if ((month == 9) && (day == 1) && (date > 7) && (date< 16)) document.write("Columbus Day (USA)");
if ((month == 9) && (day == 0) && (date > 24) && (date< 31)) document.write("Daylight Savings Time Ends");
if ((month == 9) && (day == 0) && (date == 31)) document.write("Daylight Savings Time Ends<BR>");
if ((month == 9) && (date == 24)) document.write("United Nations Day");
if ((month == 9) && (date == 31)) document.write("Halloween");
// November
if ((month == 10) && (date == 1)) document.write("All Saints Day");
if ((month == 10) && (date == 2)) document.write("All Souls Day");
if ((month == 10) && (date == 3)) document.write("Culture Day (Japan)");
if ((month == 10) && (date == 11)) document.write("Veteran's Day (USA),    Remembrance Day (Canada)");
if ((month == 10) && (date ==20)) document.write("Revolution Day (Mexico)");
if ((month == 10) && (date == 23)) document.write("Labor Thanksgiving Day (Japan)");
if ((month == 10) && (day == 4) && (date > 23) && (date< 30)) document.write("Thanksgiving (USA)");
if ((month == 10) && (date == 30) && (day == 4)) document.write("Thanksgiving (USA)");
// December
if ((month == 11) && (date == 10)) document.write("Human Rights Day");
if ((month == 11) && (date == 21)) document.write("Winter Solstice");
if ((month == 11) && (date == 24)) document.write("Christmas Eve");
if ((month == 11) && (date == 25)) document.write("Christmas");
if ((month == 11) && (date == 26)) document.write("Boxing Day");
if ((month == 11) && (date == 31)) document.write("New Year's Eve");
document.write("<br></font>");
//-->
</SCRIPT>

<p align="center"><font face="arial" size="-2">This free script provided by</font><br>
<font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
Kit</a></font></p>
Avatar billede Slawomir Seniormester
02. marts 2004 - 10:32 #9
takker for points :-)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester