Hi, Here is a little X-Mas gift, a function to compute Eastern Day:
---8<-------------------------------------------------------------------- Public Sub Eastern(Year As Integer) As Date Dim A, B, C, D, E, F, G As Integer A = Year Mod 19 + 1 B = Year Div 100 + 1 C = (3 * B) Div 4 - 12 D = (8 * B + 5) Div 25 - 5 E = (Year * 5) Div 4 - 10 - C F = ((11 * A + 20 + D - C) Mod 30 + 30) Mod 30 If F = 24 Or (F = 25 And A > 11) Then Inc F G = 44 - F If G < 21 Then G = G + 30 Return DateAdd(Date(Year, 3, 1), gb.Day, G + 7 - (E + G) Mod 7 - 1) End ---8<-------------------------------------------------------------------- I will put it in the 'gb.util' component. Regards, -- Benoît Minisini ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
