FinWX Foorumi
torstai, 24.05.2012, 01:23 *
Tervetuloa, Vieras. Ole hyvä ja kirjaudu tai rekisteröidy.
Jäikö aktivointi sähköposti saamatta?

Kirjaudu käyttäjätunnuksen, salasanan ja istunnonpituuden mukaan
Uutiset:
06.05.2012
Toivotamme tervetulleeksi FinWX:n 69. jäsen-sääaseman, FinWX Turku-54:n.
Sääasema on Länsi-Suomen läänin 25. FinWX-asema.

Lue lisää uudesta jäsenasemasta täältä.
 
   Etusivu   Ohjeet Haku Kalenteri Kirjaudu Rekisteröidy  
Sivuja: 1 [2]
  Tulostusversio  
Kirjoittaja Aihe: Jotain ei nyt ihan täsmää...  (Luettu 438 kertaa)
0 jäsentä ja 3 vierasta katselee tätä aihetta.
miihkali
Foorumiriippuvainen
****
Poissa Poissa

Viestejä: 205


« Vastaus #10 : maanantai, 26.09.2011, 07:56 »

http://www.eeki.biz/paivan_tasaus_seisaus.php

Wiki on tynkä.


more in english:
http://en.wikipedia.org/wiki/Equinox
http://en.wikipedia.org/wiki/Solstice

linux-ukkojen Remind-kalenterin koodia, jos kiinnostaa jotakuta:

REM [trigger(date(2010, 1, 3), time( 0,00), 1)] MSG Perihelion
REM [trigger(date(2010, 3,20), time(17,32), 1)] MSG Equinox
REM [trigger(date(2010, 6,21), time(11,28), 1)] MSG Solstice
REM [trigger(date(2010, 7, 6), time(11,00), 1)] MSG Aphelion
REM [trigger(date(2010, 9,23), time( 3,09), 1)] MSG Equinox
REM [trigger(date(2010,12,21), time(23,38), 1)] MSG Solstice
REM [trigger(date(2011, 1, 3), time(19,00), 1)] MSG Perihelion
REM [trigger(date(2011, 3,20), time(23,21), 1)] MSG Equinox
REM [trigger(date(2011, 6,21), time(17,16), 1)] MSG Solstice
REM [trigger(date(2011, 7, 4), time(15,00), 1)] MSG Aphelion
REM [trigger(date(2011, 9,23), time( 9,04), 1)] MSG Equinox
REM [trigger(date(2011,12,22), time( 5,30), 1)] MSG Solstice
REM [trigger(date(2012, 1, 5), time( 0,00), 1)] MSG Perihelion
REM [trigger(date(2012, 3,20), time( 5,14), 1)] MSG Equinox
REM [trigger(date(2012, 6,20), time(23,09), 1)] MSG Solstice
REM [trigger(date(2012, 7, 5), time( 3,00), 1)] MSG Aphelion
REM [trigger(date(2012, 9,22), time(14,49), 1)] MSG Equinox
REM [trigger(date(2012,12,21), time(11,11), 1)] MSG Solstice
REM [trigger(date(2013, 1, 2), time( 5,00), 1)] MSG Perihelion
REM [trigger(date(2013, 3,20), time(11,02), 1)] MSG Equinox
REM [trigger(date(2013, 6,21), time( 5,04), 1)] MSG Solstice
REM [trigger(date(2013, 7, 5), time(15,00), 1)] MSG Aphelion
REM [trigger(date(2013, 9,22), time(20,44), 1)] MSG Equinox
REM [trigger(date(2013,12,21), time(17,11), 1)] MSG Solstice
REM [trigger(date(2014, 1, 4), time(12,00), 1)] MSG Perihelion
REM [trigger(date(2014, 3,20), time(16,57), 1)] MSG Equinox
REM [trigger(date(2014, 6,21), time(10,51), 1)] MSG Solstice
REM [trigger(date(2014, 7, 4), time( 0,00), 1)] MSG Aphelion
REM [trigger(date(2014, 9,23), time( 2,29), 1)] MSG Equinox
REM [trigger(date(2014,12,21), time(23,03), 1)] MSG Solstice
REM [trigger(date(2015, 1, 4), time( 7,00), 1)] MSG Perihelion
REM [trigger(date(2015, 3,20), time(22,45), 1)] MSG Equinox
REM [trigger(date(2015, 6,21), time(16,38), 1)] MSG Solstice
REM [trigger(date(2015, 7, 6), time(19,00), 1)] MSG Aphelion
REM [trigger(date(2015, 9,23), time( 8,20), 1)] MSG Equinox
REM [trigger(date(2015,12,22), time( 4,48), 1)] MSG Solstice
REM [trigger(date(2016, 1, 2), time(23,00), 1)] MSG Perihelion
REM [trigger(date(2016, 3,20), time( 4,30), 1)] MSG Equinox
REM [trigger(date(2016, 6,20), time(22,34), 1)] MSG Solstice
REM [trigger(date(2016, 7, 4), time(16,00), 1)] MSG Aphelion
REM [trigger(date(2016, 9,22), time(14,21), 1)] MSG Equinox
REM [trigger(date(2016,12,21), time(10,44), 1)] MSG Solstice
REM [trigger(date(2017, 1, 4), time(14,00), 1)] MSG Perihelion
REM [trigger(date(2017, 3,20), time(10,28), 1)] MSG Equinox
REM [trigger(date(2017, 6,21), time( 4,24), 1)] MSG Solstice
REM [trigger(date(2017, 7, 3), time(20,00), 1)] MSG Aphelion
REM [trigger(date(2017, 9,22), time(20,02), 1)] MSG Equinox
REM [trigger(date(2017,12,21), time(16,28), 1)] MSG Solstice
REM [trigger(date(2018, 1, 3), time( 6,00), 1)] MSG Perihelion
REM [trigger(date(2018, 3,20), time(16,15), 1)] MSG Equinox
REM [trigger(date(2018, 6,21), time(10,07), 1)] MSG Solstice
REM [trigger(date(2018, 7, 6), time(17,00), 1)] MSG Aphelion
REM [trigger(date(2018, 9,23), time( 1,54), 1)] MSG Equinox
REM [trigger(date(2018,12,21), time(22,22), 1)] MSG Solstice
REM [trigger(date(2019, 1, 3), time( 5,00), 1)] MSG Perihelion
REM [trigger(date(2019, 3,20), time(21,58), 1)] MSG Equinox
REM [trigger(date(2019, 6,21), time(15,54), 1)] MSG Solstice
REM [trigger(date(2019, 7, 4), time(22,00), 1)] MSG Aphelion
REM [trigger(date(2019, 9,23), time( 7,50), 1)] MSG Equinox
REM [trigger(date(2019,12,22), time( 4,19), 1)] MSG Solstice
REM [trigger(date(2020, 1, 5), time( 8,00), 1)] MSG Perihelion
REM [trigger(date(2020, 3,20), time( 3,49), 1)] MSG Equinox
REM [trigger(date(2020, 6,20), time(21,43), 1)] MSG Solstice
REM [trigger(date(2020, 7, 4), time(12,00), 1)] MSG Aphelion
REM [trigger(date(2020, 9,22), time(13,30), 1)] MSG Equinox
REM [trigger(date(2020,12,21), time(10,02), 1)] MSG Solstice

toimii minuutilleen ja sillai
« Viimeksi muokattu: maanantai, 26.09.2011, 08:34 kirjoittanut miihkali » tallennettu
tito
Kiinteä osa Foorumia
*****
Poissa Poissa

Viestejä: 366



« Vastaus #11 : maanantai, 26.09.2011, 08:32 »

Lainaus
Kirjoittanut: miihkali
Lainaus
http://www.eeki.biz/paivan_tasaus_seisaus.php

Wiki on tynkä.

Eikös oleellisinta ole tämä? Iskee silmää

Lainaus
Aurinko on silloin zeniitissä päiväntasaajalla ja siirtyy pohjoiselta eteläiselle pallonpuoliskolle
tallennettu

J.Laiho
Foorumin ylläpitäjä
Ylläpito
*****
Poissa Poissa

Viestejä: 3645



WWW
« Vastaus #12 : maanantai, 26.09.2011, 09:30 »

Tuli mieleen oliskos php:ssä $zenith-asetuksella jotain tekemistä asian tiimoilta? Iskee silmää
$zenith=90+33/60;

Sillä, miten PHP purkaa tuon kellonajan, on juuri tuolla se suurin merkitys.
FinWX:n sivustolla on omat osansa jokaisella hämärätapahtumalla ja FinWX:n sivuston kohdalla koodi on tämän näköinen:

Koodia:
<?php
// SUNDIAL 2.15
// by Juha Laiho, (C) 2007-2009 -  http://www.finwx.net
//

include "init.php";

//TIME VARIABLES
$dst=date('I');

//SUNRISE AND SUNSET VARIABLES
$lat $FinWXlat;
$long $FinWXlon;
if (
$dst == 1) {$offset 3;} else {$offset 2;}
$zenith_s 90 50 60;
$zenith_ct 96;
$zenith_nt 102;
$zenith_at 108;
$sunrise=date_sunrise(time(), SUNFUNCS_RET_STRING$lat$long$zenith_s$offset);
$sunset=date_sunset(time(), SUNFUNCS_RET_STRING$lat$long$zenith_s$offset);
$civiliantwb=date_sunrise(time(), SUNFUNCS_RET_STRING$lat$long$zenith_ct$offset);
$civiliantwe=date_sunset(time(), SUNFUNCS_RET_STRING$lat$long$zenith_ct$offset);
$nauticaltwb=date_sunrise(time(), SUNFUNCS_RET_STRING$lat$long$zenith_nt$offset);
$nauticaltwe=date_sunset(time(), SUNFUNCS_RET_STRING$lat$long$zenith_nt$offset);
$astronomicaltwb=date_sunrise(time(), SUNFUNCS_RET_STRING$lat$long$zenith_at$offset);
$astronomicaltwe=date_sunset(time(), SUNFUNCS_RET_STRING$lat$long$zenith_at$offset);

//HTML-PAGE OUTPUT
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Language" content="fi">
<meta name="Author" content="Juha Laiho">
<meta name="Copyright" content="Finland Weather Exchange (FinWX) / www.finwx.net">
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
<title></title>
</head>
<body link="#808080" vlink="#C0C0C0" alink="#CCCCCC" style="font-family: Arial, Helvetica, sans-serif" text="#000000" bgcolor="#E1E1E1">
<table border="0" width="100%" id="sundial" cellspacing="0" cellpadding="0">
<tr>
<td width="200"><font size="2" color="0000EE">Tähtitaivas alkaa vaaleta</font></td>
<td><font size="2">'
.$astronomicaltwb.'</font></td>
</tr>
<tr>
<td width="200"><font size="2" color="9933FF">Merellinen hämärä alkaa</font></td>
<td><font size="2">'
.$nauticaltwb.'</font></td>
</tr>
<tr>
<td width="200"><font size="2" color="CC6600">Aamuhämärä alkaa</font></td>
<td><font size="2">'
.$civiliantwb.'</font></td>
</tr>
<tr>
<td width="200"><font size="2" color="FF9900">AURINKO NOUSEE</font></td>
<td><font size="2">'
.$sunrise.'</font></td>
</tr>
<tr>
<td width="200">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="200"><font size="2" color="FF3300">AURINKO LASKEE</font></td>
<td><font size="2">'
.$sunset.'</font></td>
</tr>
<tr>
<td width="200"><font size="2" color="990066">Iltahämärä päättyy</font></td>
<td><font size="2">'
.$civiliantwe.'</font></td>
</tr>
<tr>
<td width="200"><font size="2" color="660099">Merellinen hämärä päättyy</font></td>
<td><font size="2">'
.$nauticaltwe.'</font></td>
</tr>
<tr>
<td width="200"><font size="2" color="2200BB">Tähtitaivas on tummunut</font></td>
<td><font size="2">'
.$astronomicaltwe.'</font></td>
</tr>
</table>
</body>
</html>
'
;
?>



ja selvennyksenä vielä, että:
- sunrise = Auringon nousuaika
- sunset = Auringon laskuaika
- civiliantwb = Siviilihämärä alkaa
- civiliantwe = Siviilihämärä päättyy
- nauticaltwb = Nauttinen (=merellinen) hämärä alkaa
- nauticaltwb = Nauttinen (=merellinen) hämärä päättyy
- astronomicaltwb = Astronominen hämärä alkaa
- astronomicaltwe = Astronominen hämärä päättyy

Koodia saa käyttää vapaasti sivustollaan kuten haluaa ja muovata, miten haluaa. Hymyilee
Se, kuinka oikein kellonaika todellisuudessa on, en uskalla antaa takeita, mutta pitäisivät olla aika lailla oikeat.
tallennettu

Juha Laiho
Foorumin ja sivuston ylläpitäjä
Finland Weather Exchange (FinWX)

http://www.finwx.net/
------------------------------------------
Twitter, FinWX:n havainnot
------------------------------------------
Ukkoslaskuri 2012; Lohja, Gruotila
0 ukkospäivää.
------------------------------------------

------------------------------------------
weatherc
Foorumin Yleismoderaattori
*****
Paikalla Paikalla

Viestejä: 4550


« Vastaus #13 : maanantai, 26.09.2011, 14:41 »

Lainaus
Sillä, miten PHP purkaa tuon kellonajan, on juuri tuolla se suurin merkitys.
FinWX:n sivustolla on omat osansa jokaisella hämärätapahtumalla ja FinWX:n sivuston kohdalla koodi on tämän näköinen:

Nuo samat civilianit ja nauticalit ovat käytössä omallakin aurinkosivulla.
Tuo 90+50/60 on se mikä php.net:kin antaa yleistoimivaksi asetukseksi.
Testailin tuon "normaalin" aurinkoajan zenit-asetuksen kanssa ja tulos oli pikkasen yllättäväkin, nimittäin 50/60 ei antanut samaa aikaa mitä WD/Gaisma vaan sen antoi 40/60, näin ainakin toissapäivänä. Se on sitten aivan eri asia että onko niin vielä jouluna.

Kun impletoin nuo aurinkoajat NWN:ään käyttäen muistaakseni tuota 50/60-asetusta tuli heti palautetta joiltain asemilta etteivät ajat täsmää, siitä tuo 33/60.
tallennettu

Sivuja: 1 [2]
  Tulostusversio  
 
Siirry:  

MySQL pohjainen foorumi PHP pohjainen foorumi Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Validi XHTML 1.0! Validi CSS!