Geschrieben von needmna am 24.01.2006, 22:38

Hier habt Ihr ein Script, welches auf einer Homepage die Zeit, Datum sowie den Tag angiebt.
Viel Spass wünscht needmna

<html>
<HEAD>
<TITLE>Zeit</TITLE>
<SCRIPT language=JavaScript>

function clock() {
var Zeit = new Date();
var Stunden = Zeit.getHours();
var Minuten = Zeit.getMinutes();
var Sekunden = Zeit.getSeconds();
var Tag = Zeit.getDate();
var Monat = Zeit.getMonth()+1;
var Jahr = Zeit.getFullYear();
var Wochentag = Zeit.getDay();

var then=Zeit.getTime();
var now=(then/1000);
var units=(now/17280);
var diff=(-350647.8);
var cent=(-36);
var date=(units+diff);

var Wochentage = new Array ("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");

if (Stunden == 0) Stunden = "00";
if (Stunden <= 9 && Stunden != "00") Stunden = "0" + Stunden;
if (Minuten <= 9) Minuten = "0" + Minuten;
if (Sekunden <= 9) Sekunden = "0" + Sekunden;

if (Tag <= 9) Tag = "0" + Tag;
if (Monat <= 9) Monat = "0" + Monat;

var TZeit = Stunden + ":" + Minuten + ":" + Sekunden;
var TDatum = Tag + "." + Monat + "." + Jahr;
var TTag = Wochentage[Wochentag];

TKomplett = Wochentage[Wochentag] + ", der " + Tag + "." + Monat + "." + Jahr + ", " + Stunden + ":" + Minuten;

Uhrzeit.innerHTML = TZeit;
Datum.innerHTML = TDatum;
WTag.innerHTML = TTag;

if (date>=0) {
var timeValue = "Stardate Calendar has been implemented. Refer to Federation Timebase."
Sternzeit.innerHTML = timeValue
}

if((date<0)&&(date>-10000)){
cent=(-1);
date=(""+(10000+date));
date=date.substring(0,7);
date=parseFloat(date);
var timeValue = "[" + cent
timeValue += "]" + date
Sternzeit.innerHTML = timeValue
}
if((date<=-10000)&&(date>-100000)){
var digit=(""+(date/10000));
digit=digit.substring(0,2);
digit=parseInt(digit);
date=date-(digit*10000);
cent=(digit-1);
date=(""+(10000+date));
date=date.substring(0,7);
date=parseFloat(date);
var timeValue = "[" + cent
timeValue += "]" + date
Sternzeit.innerHTML = timeValue
}

if(date<=-100000){
var digit=(""+(date/10000));
digit=digit.substring(0,3);
digit=parseInt(digit);
date=date-(digit*10000);
cent=(digit-1);
date=(""+(10000+date));
date=parseFloat(date.substring(0,7));
var timeValue = "[" + cent
timeValue += "]" + date
Sternzeit.innerHTML = timeValue
}

setTimeout("clock()", 1000);
}

function zeige_Zeit_und_Datum(src) {
src.title = TKomplett;
}

</SCRIPT>
</HEAD>

<BODY onmouseover=zeige_Zeit_und_Datum(this) title="Donnerstag, der 20.03.2003, 12:51" style="CURSOR: default; BACKGROUND-COLOR: #99ccff" scroll=no onload=clock()>

<SPAN id=Uhrzeit style="FONT-WEIGHT: bold; FONT-SIZE: 0pt; FILTER: ; LEFT: 3px; VISIBILITY: hidden; COLOR: #5511ff; FONT-STYLE: italic; FONT-FAMILY: Arial; POSITION: absolute; TOP: -1px">12:53:51</SPAN>

<SPAN id=Datum style="FONT-WEIGHT: bold; FONT-SIZE: 20px; FILTER: Alpha(opacity=70, finishopacity=50, style=3); LEFT: 15px; VISIBILITY: visible; COLOR: #000000; FONT-STYLE: normal; FONT-FAMILY: comic sans ms; POSITION: absolute; TOP: 0px">20.03.2003</SPAN>

<SPAN id=WTag style="FONT-WEIGHT: normal; FONT-SIZE: 20px; FILTER: Alpha(opacity=70, finishopacity=50, style=3); LEFT: 15px; VISIBILITY: visible; COLOR: #000000; FONT-STYLE: italic; FONT-FAMILY: comic sans ms; POSITION: absolute; TOP: 22px">Donnerstag</SPAN>

<SPAN id=Sternzeit style="FONT-WEIGHT: normal; FONT-SIZE: 0pt; FILTER: Alpha(opacity=70, finishopacity=50, style=3); LEFT: 119px; VISIBILITY: hidden; COLOR: #000000; FONT-STYLE: normal; FONT-FAMILY: Small Fonts; POSITION: absolute; TOP: 99px">[-29]9.67865</SPAN>
</BODY>
</html>

//Ende des listings

Bewertung Anzahl
6
18,2 %
2 Bewertungen
5
27,3 %
3 Bewertungen
4
18,2 %
2 Bewertungen
3
36,4 %
4 Bewertungen