Define heure_sidérale()= Prgm :Local jr,mo,smo,an,san,hr,h,mn,m,smn,sc,s,ssc :Local n,bx,z,i,dst,b,c,d,e,jj,j,t,tta,h,tu :Local hs,hd,hsd,hsi,msi,ssi,lgd,lgm,lgs,ew :0→jr:0→mo:0→smo:0→an:0→san:0→hr :0→h:0→mn:0→m:0→smn:0→sc:0→s:0→ssc :28→n:0→bx:1720994.5→z:0→dst:0→b:0→c :0→d:0→e:0→jj:0→j:0→t:0→tta:0→h:0→tu :0→hs:0→hd:0→hsd:0→hsi:0→msi:0→ssi :0→lgd:0→lgm:0→lgs:0→ew :setMode(5,2) :©---------------------explications :Disp "" :Disp " Donner la date et l'heure en chiffres " :Disp " DST: 0 pour hr Greenwish" :Disp " 1 pour hr d'hivers, 2 hr pour été" :Disp " appuyez sur [enter] pour continuer" :For i,1,2:Disp "":EndFor :getKey(1) :©---------------demandes utilisateur :Request "jour : ",jr :Request "mois : ",mo :Request "année : ",an :Request "heure",hr :Request "minute",mn :Request "seconde",sc :Request "DST =",dst :If dst<1 or dst>2:Goto err :If dst=1:hr-1→hr :If dst=2:hr-2→hr :©-------------voir si année bissextile :If mod(an,4)=0 and mod(an,100)≠0 or mod(an,400)=0 : 1→bx :©------------------- contrôle date :If jr<1:Goto err :If mo<1:Goto err :If an<−4712 or an=0 or an>9999:Goto err :If jr>30 Then : If mo=4 or mo=6 or mo=9 or mo=11 : Goto err :EndIf :If jr>31 Then : If mo=1 or m=3 or mo=5 or mo=7 or mo=8 or mo=10 or mo=12 : Goto err :EndIf :If mo=2 and jr>n+bx:Goto err :©------------------- contrôle heure :©While hr>23 or hr<0 or mn>60 or sc>60 : If hr>23:hr-24→hr : If hr<0:hr+24→hr : If mo>60:mo-60→mo : If sc>60:sc-60→sc :©EndWhile :mo→smo:an→san:mn→smn:sc→ssc :©-------Calc jj Greenwich à 0 heure TU :If mo<3 Then : an-1→an:mo+12→mo :EndIf :int(((an)/(100)))→b :2-b+int(((b)/(4)))→c :int(365.25*an)→d :int(30.6001*(mo+1))→e :c+d+e+jr+z→jj :jj→j :©------conv hr utilisateur en hr décimale :((sc)/(60))→m :((m+mn)/(60))→h :hr+h→hd :©---Calc Tsid Greenwich pour 0 heure TU :((jj-2415020)/(36525))→t :0.276919398+100.0021359*t+1.075−6*t^(2)→tta :fPart(tta)*24→hs :©------Calc tps sid Greenwich utilisateur :hd*1.002737908→hd :hs+hd→hs :©---------conv hr sid utilisateur en hms :int(hs)→hsi :fPart(hs)*60→m :int(m)→msi :fPart(m)*60→ssi :round(ssi,3)→ssi :©------------------------ affiche :For i,1,2:Disp "":EndFor :Disp "le",jr,"/",smo,"/",san," - ",hr,"hr",smn,"mn",ssc,"sec" :Disp "jour julien: ",j :Disp "" :Disp "hr sid décim ",hs :Disp "" :Disp "hr sid",hsi,"hr ",msi,"mn ",ssi,"sec" :Disp "" :Disp " Entrer pour sortir !" :getKey(1) :Goto fin :©------------------------- erreur :Lbl err :For i,1,2:Disp "":EndFor :Disp "le",jr,"/",mo,"/",an,"à",hr,":",mn,":",sc :Disp "" :Disp " Désolé cette instant n'est pas valide" :For i,1,2:Disp "":EndFor :©--------------------------- fin :Lbl fin :EndPrgm