Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.53 KB | None | 0 0
  1. new terminday = 0, terminmonth = 0, terminyear = 0, days = 0;
  2. new year, month, day;
  3. getdate(year, month, day);
  4. if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)
  5. {
  6.     terminday = day+14;
  7.     if(terminday > 31)
  8.     {
  9.         terminmonth = month+1;
  10.         if(terminmonth > 12)
  11.         {
  12.             terminyear = year+1;
  13.             terminmonth = 1;
  14.             terminday = terminday-31;
  15.         }
  16.         else
  17.         {
  18.             terminyear = year;
  19.             if(terminmonth == 1 || terminmonth == 3 || terminmonth == 5 || terminmonth == 7 || terminmonth == 8 || terminmonth == 10 || terminmonth == 12)
  20.             {
  21.                 days = 31;
  22.             }
  23.             else if(terminmonth == 2)
  24.             {
  25.                 days = 28;
  26.             }
  27.             else
  28.             {
  29.                 days = 30;
  30.             }
  31.             terminday = terminday-days;
  32.         }
  33.     }
  34.     else
  35.     {
  36.         terminmonth = month;
  37.         terminyear = year;
  38.     }
  39. }
  40. else if(month == 2)
  41. {
  42.     terminday = day+14;
  43.     if(terminday > 28)
  44.     {
  45.         terminmonth = month+1;
  46.         terminyear = year;
  47.         terminday = terminday-28;
  48.     }
  49.     else
  50.     {
  51.         terminmonth = month;
  52.         terminyear = year;
  53.     }
  54. }
  55. else
  56. {
  57.     terminday = day+14;
  58.     if(terminday > 30)
  59.     {
  60.         terminmonth = month+1;
  61.         terminyear = year;
  62.         if(terminmonth == 1 || terminmonth == 3 || terminmonth == 5 || terminmonth == 7 || terminmonth == 8 || terminmonth == 10 || terminmonth == 12)
  63.         {
  64.             days = 31;
  65.         }
  66.         else if(terminmonth == 2)
  67.         {
  68.             days = 28;
  69.         }
  70.         else
  71.         {
  72.             days = 30;
  73.         }
  74.         terminday = terminday-days;
  75.     }
  76.     else
  77.     {
  78.         terminmonth = month;
  79.         terminyear = year;
  80.     }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement