mediengestalter.info
FAQ :: Mitgliederliste :: MGi Team

Willkommen auf dem Portal für Mediengestalter

Aktuelles Datum und Uhrzeit: Mi 24.04.2024 01:41 Benutzername: Passwort: Auto-Login

Thema: [JS] Zeit und Datum vom 02.03.2004


Neues Thema eröffnen   Neue Antwort erstellen MGi Foren-Übersicht -> Programmierung -> [JS] Zeit und Datum
Autor Nachricht
radal
Threadersteller

Dabei seit: 11.09.2003
Ort: -
Alter: 49
Geschlecht: Männlich
Verfasst Di 02.03.2004 15:41
Titel

[JS] Zeit und Datum

Antworten mit Zitat Zum Seitenanfang

Hi,

hab mal von einem freund folgendes schreiben lassen:

Code:

<script language=JavaScript>function uhr(){
         window.setTimeout( uhr(), 1000 );
         today    = new Date();
         var y    = today.getYear();             
         var h    = today.getHours();             
         var m    = today.getMinutes();           
         var s    = today.getSeconds();           
         var mo   = today.getMonth() + 1;                             
         var da   = today.getDate();             
         var ampm = ( © intcons.de);   
         if (m < 10) m = 0 + m;
         if (s < 10) s = 0 + s;                           
         if (da < 10) da = 0 + da;      
         if (mo < 10) mo = 0 + mo;                           
         var t = da + '.' + mo + '.' + y + '  ' + h + ':' + m +  ':' + s + ' ' + ampm;
         self.status = t.toString();
       }uhr()</script>


jetzt habe ich die Uhrzeit und datum in der statusleiste. Was soll ich verändern damit sie im Textbereich erscheinen????

Danke

IEL--> Alex

//EDIT by Sarky
Bitte Code-Tags verwenden


Zuletzt bearbeitet von Sarky am Di 02.03.2004 16:00, insgesamt 1-mal bearbeitet
  View user's profile Private Nachricht senden Website dieses Benutzers besuchen
Account gelöscht


Ort: -
Alter: -
Verfasst Di 02.03.2004 16:10
Titel

Antworten mit Zitat Zum Seitenanfang

In den <body>
<script>
// CREDITS:
// Inline clock: fits anywhere into any text
// by Urs Dudli and Peter Gehrig
// Copyright (c) 2000 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.com
// info@24fun.com
// 7/5/2001

// IMPORTANT:
// If you add this script to a script-library or a script-archive
// you have to insert a link to http://www.24fun.com
// right into the webpage where the script will be displayed.

// CONFIGURATION:
// Go to http://www.24fun.com, open category 'date' and
// download the ZIP-file of this script containing
// the script-file with step-by-step instructions for easy configuration

var clockid=new Array()
var clockidoutside=new Array()
var i_clock=-1
var thistime= new Date()
var hours=thistime.getHours()
var minutes=thistime.getMinutes()
var seconds=thistime.getSeconds()
if (eval(hours) <10) {hours="0"+hours}
if (eval(minutes) < 10) {minutes="0"+minutes}
if (seconds < 10) {seconds="0"+seconds}
var thistime = hours+":"+minutes+":"+seconds

function writeclock() {
i_clock++
if (document.all || document.getElementById || document.layers) {
clockid[i_clock]="clock"+i_clock
document.write("<font family=arial size=2><span id='"+clockid[i_clock]+"' style='position:relative'>"+thistime+"</span></font>")
}
}

function clockon() {
thistime= new Date()
hours=thistime.getHours()
minutes=thistime.getMinutes()
seconds=thistime.getSeconds()
if (eval(hours) <10) {hours="0"+hours}
if (eval(minutes) < 10) {minutes="0"+minutes}
if (seconds < 10) {seconds="0"+seconds}
thistime = hours+":"+minutes+":"+seconds

if (document.all) {
for (i=0;i<=clockid.length-1;i++) {
var thisclock=eval(clockid[i])
thisclock.innerHTML=thistime
}
}

if (document.getElementById) {
for (i=0;i<=clockid.length-1;i++) {
document.getElementById(clockid[i]).innerHTML=thistime
}
}
var timer=setTimeout("clockon()",1000)
}
window.onload=clockon
</script>

<table border="0">
<tr>
<td><font face="Arial" size="2" color="#000000">Es ist <script>writeclock()</script> Uhr</font></td>
</tr>

An die Stelle wo es hin soll

<script>writeclock()</script>
 
Anzeige
Anzeige
radal
Threadersteller

Dabei seit: 11.09.2003
Ort: -
Alter: 49
Geschlecht: Männlich
Verfasst Di 02.03.2004 16:14
Titel

Antworten mit Zitat Zum Seitenanfang

DAAANKE

[wat würd isch misch ohne eusch machen]
Jo! Jo! Jo!
Lächel Lächel
  View user's profile Private Nachricht senden Website dieses Benutzers besuchen
ische

Dabei seit: 09.03.2004
Ort: -
Alter: -
Geschlecht: -
Verfasst Di 09.03.2004 14:16
Titel

[JavaScript] Wie macht man das

Antworten mit Zitat Zum Seitenanfang

// selfhtml sei dank

Zuletzt bearbeitet von ische am Do 11.03.2004 14:10, insgesamt 1-mal bearbeitet
  View user's profile Private Nachricht senden
hansepunk
Account gelöscht


Ort: -

Verfasst Di 09.03.2004 14:18
Titel

hat jemand zeit...

Antworten mit Zitat Zum Seitenanfang

und lust für mich meine theoretische prüfung zu schreiben.
ist am 11.mai...es gibt dann auch einen feuchten händedruck.

*ha ha* *ha ha* *ha ha* *ha ha* Grins Grins Grins Lächel Lächel Lächel


:evil:

* grmbl *

Jo!

wenn das leben doch so einfach wäre.....

salü
m.


Zuletzt bearbeitet von am Di 09.03.2004 14:22, insgesamt 1-mal bearbeitet
 
 
Ähnliche Themen Div-Inhalt abhängig nach Zeit/Datum einblenden.
Datum umformatieren mit PHP
[PHP] Datum erstellen?!
Datum formatieren in PHP
Datum in PHP übergeben
Nach Datum sortieren
Neues Thema eröffnen   Neue Antwort erstellen
MGi Foren-Übersicht -> Programmierung


Du kannst keine Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum nicht antworten.
Du kannst an Umfragen in diesem Forum nicht mitmachen.