| |
|
|
Michael Wodrich | [size=18:9a05d71d8c]Calendar-Berechnungen:[/size:9a05d71d8c] (written in XProfan; must evtl. a little bit angepaßt go for frühere versions)
there's sure many Opportunities for management of Kalenderdaten. here go some routines pictured, a LongInt-Variable to Speicherung using.
that this possible is show I here:
2147483647 maximum positiver LongInt-worth ..CCYYMMDD the date becomes so stored ..hhmmsscc The Time becomes so stored
CC...... The centenary-indicated (Century) ..YY.... the year ....MM.. the month ......DD the day
hh...... The hour ..mm.... The Minute ....ss.. The second ......cc The Hundertstel-second (Centi)
The Profan-internen date- and Zeitfunktionen can herewith well complement go.
The subesquent routines building Date and Time together: CompileMarkSeparationSyntax: CompileMarkSeparationDatum& = MakeFullDate(Tag&,Monat&,Jahr&) z.B.: dat& = MakeFullDate(4,6,2004)
Datum& = MakeDate(Tag&,Monat&,Jahrhundert&,Jahr&) z.B.: dat& = MakeDate(4,6,20,04)
Zeit& = MakeTime(Stunde&,Minute&,Sekunde&,Hundertstel&) z.B.: tim& = MakeTime(23,30,0,40)re> decompose the Datums in its Einzelteile (Parameter is the LongInt-date): CompileMarkSeparationdecompose the Time in your Einzelteile (Parameter is the LongInt-worth): CompileMarkSeparationdate- and Time-compare: (d1 - date the 1. Wertes) (t1 - Time the 1. Wertes) (d2 - date the 2. Wertes) (t2 - Time the 2. Wertes) CompileMarkSeparationDef Time_EQ(d1,t1,d2,t2) (@&(1) = @&(3)) and (@&(2) = @&(4))
Def Time_GE(d1,t1,d2,t2) (@&(1) > @&(3)) or ((@&(1) = @&(3)) and (@&(2) >= @&(4)))
Def Time_GT(d1,t1,d2,t2) (@&(1) > @&(3)) or ((@&(1) = @&(3)) and (@&(2) > @&(4)))
Def Time_LE(d1,t1,d2,t2) (@&(1) < @&(3)) or ((@&(1) = @&(3)) and (@&(2) <= @&(4)))
Def Time_LT(d1,t1,d2,t2) (@&(1) < @&(3)) or ((@&(1) = @&(3)) and (@&(2) < @&(4)))
Def Time_NEQ(d1,t1,d2,t2) (@&(1) <> @&(3)) or (@&(2) <> @&(4)) the actually date serviert Profan already mundgerecht: CompileMarkSeparationwith the actually Time must one already a little bit More nachhelfen: CompileMarkSeparationis the angegebene year one leap-year? it go too years to the Kalenderreform correctly examined: CompileMarkSeparationdetermined whom week-day: CompileMarkSeparation MfG Michael Wodrich |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 06/05/04 ▲ |
|
|
|
|
| pointed!, we wars I to the principle a Datums-Distance there, which The Number of years,months,days between two Datumsangaben returns? |
|
|
| |
|
|
|
Michael Wodrich | through Umrechnung into Julianische Tageszahl. The is really a Float-number. I wanted to the Whole in LongInt keep, but since is the worm drin. time see, I poste the thing on the afternoon time. now Have I unfortunately no Streichhölzer More, around the eyes aufzuhalten...
To then Michael Wodrich |
|
|
| Programmieren, das spannendste Detektivspiel der Welt. | 06/07/04 ▲ |
|
|
|
|
Sven Bader | i will really too only The distance zweiter data Perhaps is the for somebody interestingly, The Number of days one month's, Schaltjahrprüfung for february is too thereby.
Def days(2) int(28+val(mid$(303232332323,&(1),1))+if((&(1)=2) & (&(2) MOD 4 = 0),1,0))
appeal: print days(02,2004) spending: 29 february 2004 having 29 days |
|
|
| |
|
|