Day of week etc

, \t\t , Day of week, Day of year etc, Contributor: SWAG SUPPORT TEAM, Program Gregorian; { Julian day to Gregorian date }, Uses Crt; { Turbo/Quick Pascal }, Type String3 = String[3];,         String9 = String[9];, Const MonthName : Array [1..12] of String3 =,                           ('Jan','Feb','Mar','Apr','May','Jun',,                            'Jul','Aug','Sep','Oct','Nov','Dec');,         DayName : Array [1..7] of String9 =,                           (与# 39;星期日,与#';39;星期一,与#';39;星期二,与#';39;星期三及# 39;,,                           和# 39;星期四,与#';39;星期五,# 39;与# 39;星期六及# 39;);,无功的一天,julianday,F:房;,        月:字节;,        年:整数;,        ,B,C,D,E,G,Z:LongInt;,        闰年:布尔函数;,周(月:字节;天:房;年:整数):字节;,        VaR ivar1,ivar2:整数;,        开始,                ivar1:=年mod 100;,                ivar2:= trunc(天)+ ivar1 + ivar1 Div 4,         ;       案月,                        4、7:ivar1:= 0;,                        1、10:ivar1:= 1;,                        5:ivar1:= 2;,                        8:ivar1:= 3;,                        2,3,11:ivar1:= 4;,                        6:ivar1:= 5;,                        9:ivar1:= 6;,                        {案例},                结束;ivar2:=(ivar1 + ivar2)mod 7;,                如果(ivar2 = 0)然后ivar2:= 7;,                DayOfWeek:=字节(ivar2);最后,        ;{周},功能dayoftheyear(月:字节;天:房):整数;,        VAR N:整数;,,        开始,                如果闰年则N:= 1 N = 2;否则,                N = 275 * 9个月的div,                     N *((月+ 9)DIV 12),                     + trunc(天)30;,                dayoftheyear:= N;,        端;{ } { }开始dayoftheyear,公历,        clrscr;,        Writeln(与# 39;公历日期v0.0 dec.91格雷戈魏格纳尔特与# 39;);,        Writeln(与# 39;[进入Julian天值]和# 39;);,        重复方法;,                写(与# 39;输入(正)朱利安日数:与# 39;);,                readln(julianday);,        直到(julianday >;= 706);,        julianday:= julianday + 0.5;,        Z = trunc(julianday);F:=压裂(julianday);,        如果(Z <;2299161),        然后:= Z,其他        开始G = trunc((Z 1867216.25)/36524.25);,                        := Z + 1 + G G DIV 4;,                端;{如果},        B:= + 1524;C:= trunc((B - 122.1)/365.25);,        D = trunc(365.25×C); E := TRUNC( ( B - D ) /30.6001 );,         Day := B - D - TRUNC( 30.6001 * E ) + F;,         if ( E < 13.5 ),         then Month := Byte( E - 1 ),         else if ( E > 13.5 ) then Month := Byte( E - 13 );,         if ( Month > 2.5 ),         then Year := Integer( C - 4716 ),         else if ( Month < 2.5 ) then Year := Integer( C - 4715 );,         if ((Year MOD 100)<>0) and ((Year MOD 4)=0),                 then LeapYear := True,                 else LeapYear := False;,         Write(#10,'Gregorian '); if LeapYear then Write('LeapYear ');,         WriteLn('date is ',DayNAmy [(dag, week, maand,                                 jaar)], en', en' [de];,, en' en', dag en #: 2 - 2, 39, en #; 39 39: 4 jaar;,,,                                   en&#(dagen per jaar en #; = 39;, dayoftheyear (maand en dag), en') en' 10), #, voorbij is.{-),



Previous:
Next Page: