Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Faza księżyca
krk
post
Post #1





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 18.08.2007

Ostrzeżenie: (10%)
X----


Witam szukam skryptu php na stronę o fazach księżyca tak jak jest np. tu http://pzl.suwalki.pl/
Go to the top of the page
+Quote Post
loganek
post
Post #2





Grupa: Zarejestrowani
Postów: 81
Pomógł: 20
Dołączył: 14.06.2007

Ostrzeżenie: (0%)
-----


Kod
var height=1;

var size = 23;

var i;

var currentDate  = new Date();

var x = currentDate;

currentDate.setTime(currentDate.getTime() + (currentDate.getTimezoneOffset()*60000));

var blueMoonDate = new Date(96, 1, 3, 16, 15, 0);

var lunarPeriod  = 29*(24*3600*1000) + 12*(3600*1000) + 44.05*(60*1000);

var moonPhaseTime = (currentDate.getTime() - blueMoonDate.getTime()) % lunarPeriod;

var percentRaw = (moonPhaseTime / lunarPeriod);

var percent    = Math.round(100*percentRaw) / 100;

var percentBy2 = Math.round(200*percentRaw);

var left  = (percentRaw >= 0.5) ? black : white;

var right = (percentRaw >= 0.5) ? white : black;

var time = Math.round((lunarPeriod-moonPhaseTime)/(24*3600*1000));

nie wiem czy cały kod potrzebny, w każdym razie w zmiennej time masz ile zostało do pełni;p


--------------------
Impossible is nothing!!!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 03:53