Results 1 to 4 of 4

Thread: Day of week

  1. #1
    Join Date
    Feb 2006
    Posts
    406
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Day of week

    yeah, this converts a date to which day of the week it is
    i dont know how it works, i found the formula on the internet
    its not really good for anything, but i typed in some holidays and whatever
    you can find out on what day you were born

    Code:
    program dayofweek;
    var
      year:integer;
      
    function numberday(number:integer):string;
    begin
      case number of
      0:result:='Sunday';
      1:result:='Monday';
      2:result:='Tuesday';
      3:result:='Wednesday';
      4:result:='Thursday';
      5:result:='Friday';
      6:result:='Saturday';
      end;
    end;
    
    function convert(day,month,year:integer):string;
    var
      a,y,m:integer;
    begin
      a:=(14-month) div 12;
      y:=year-a;
      m:=month+ 12*a -2;
      result:=numberday((day + y + y div 4 - y div 100 + y div 400+ (31 * m) div 12)mod 7);
    end;
    
    procedure holidays;
    begin
      writeln('The year is '+inttostr(year));
      writeln('New Years: '+convert(1,1,year))
      writeln('Valentines Day: '+convert(14,2,year))
      writeln('St Patricks Day: '+convert(17,3,year))
      writeln('April Fools: '+convert(1,4,year))
      writeln('Earth Day: '+convert(22,4,year))
      writeln('July 4: '+convert(4,7,year))
      writeln('Halloween: '+convert(31,10,year))
      writeln('Christmas: '+convert(25,12,year))
    end;
    
    begin
    year:=2006;
    holidays;
    //you can do your birthday or whatever, format is day,month,year
    end.

  2. #2
    Join Date
    Mar 2006
    Posts
    509
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i think your missing today as a holiday? (jk haha)
    Currently Working on: Its a Secret
    WSP!! <3 bebe

  3. #3
    Join Date
    Feb 2006
    Location
    Pennsylvania
    Posts
    1,524
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Mutant Squirrle
    i think your missing today as a holiday? (jk haha)
    Haha my favorite holiday of the year.

  4. #4
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Interesting method.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. the most in a week of autoing
    By khawk3lite in forum NOTA
    Replies: 1
    Last Post: 03-03-2009, 10:31 PM
  2. Leecher of the Week
    By Jackrawl in forum The Bashing Club / BBQ Pit
    Replies: 6
    Last Post: 09-23-2007, 02:08 PM
  3. Message of the Week
    By WT-Fakawi in forum RuneScape News and General
    Replies: 18
    Last Post: 09-15-2007, 04:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •