Bonjour, Voilà j'ai un script pour afficher les heures de différents pays dans le monde, j'affiche les heures en me basant sur l'heure GMT, mais apparemment ça ne fonctionne pas, excepté chez moi ! Donc apparemment ce n'est pas l'heure GMT qui s'affiche mais l'heure système.
Que faut-il que je change ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64 <script language="JavaScript"> //Script GMT fonctionne var timerID = null var timerRunning = false function stopclock(){ if(timerRunning) clearTimeout(timerID) timerRunning = false } function startclock01(){ stopclock() showtime() } function showtime(){ var now = new Date() var minutes = now.getMinutes() var seconds = now.getSeconds() var GMT = (now.getHours() + 00) var hoursGMT = (GMT - 09) var timeValueGMT = "" + ( (hoursGMT > 12) ? hoursGMT - 12 : hoursGMT ) timeValueGMT += ( (minutes < 10) ? ":0" : ":" ) + minutes timeValueGMT += ( (seconds < 10) ? ":0" : ":" ) + seconds timeValueGMT += (hoursGMT >= 12) ? " PM" : " AM" document.clock.faceGMT.value = timeValueGMT var hoursEET = (GMT - 05) var timeValueEET = "" + ( (hoursEET > 12) ? hoursEET - 12 : hoursEET ) timeValueEET += ( (minutes < 10) ? ":0" : ":" ) + minutes timeValueEET += ( (seconds < 10) ? ":0" : ":" ) + seconds timeValueEET += (hoursEET >= 12) ? " PM" : " AM" document.clock.faceEET.value = timeValueEET var hoursEEP = (GMT + 00) var timeValueEEP = "" + ( (hoursEEP > 12) ? hoursEEP - 12 : hoursEEP ) timeValueEEP += ( (minutes < 10) ? ":0" : ":" ) + minutes timeValueEEP += ( (seconds < 10) ? ":0" : ":" ) + seconds timeValueEEP += (hoursEEP >= 12) ? " PM" : " AM" document.clock.faceEEP.value = timeValueEEP var hoursCET = (GMT + 03) var timeValueCET = "" + ( (hoursCET > 12) ? hoursCET - 12 : hoursCET ) timeValueCET += ( (minutes < 10) ? ":0" : ":" ) + minutes timeValueCET += ( (seconds < 10) ? ":0" : ":" ) + seconds timeValueCET += (hoursCET >= 12) ? " PM" : " AM" document.clock.faceCET.value = timeValueCET var hoursPST = (GMT + 07) var timeValuePST = "" + ( (hoursPST > 12) ? hoursPST - 12 : hoursPST ) timeValuePST += ( (minutes < 10) ? ":0" : ":" ) + minutes timeValuePST += ( (seconds < 10) ? ":0" : ":" ) + seconds timeValuePST += (hoursPST >= 12) ? " PM" : " AM" document.clock.facePST.value = timeValuePST timerID = setTimeout("showtime()",1000) timerRunning = true } </script>
Merci
Partager