SHARE
TWEET

Untitled

a guest May 22nd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def next_date(day,month,year):
  2.  
  3.     flag = False
  4.  
  5.     day = day + 1
  6.  
  7.     if year%4 == 0:
  8.        
  9.         if year % 100:
  10.             if year%400 == 0:
  11.                 flag =  True
  12.             else:
  13.                 flag = False
  14.         else :
  15.             flag = True
  16.     else :
  17.         flag = False
  18.    
  19.    
  20.     if month in [1,3,5,7,9,11]:        
  21.         if day >31:
  22.             day = 1
  23.             month = month + 1
  24.  
  25.     elif month in [4,6,8,10,12]:
  26.         if day >30:
  27.             day = 1
  28.             month = month + 1
  29.  
  30.     elif month == 2 :
  31.         if flag == True :
  32.             if day > 29:
  33.                 day = 1
  34.                 month = month + 1
  35.         else :
  36.             if day >28 :
  37.                 day = 1
  38.                 month = month + 1
  39.    
  40.     if month > 12:
  41.         month = 1
  42.         year = year + 1
  43.  
  44.     print(day,"-",month,"-",year)
  45.  
  46.  
  47. next_date(31,11,2019)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top