Advertisement
Guest User

Untitled

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