Guest User

Untitled

a guest
Feb 18th, 2020
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. import datetime
  2.  
  3. class Date:
  4.     def __init__(self, year, month, day):
  5.         self.year = year
  6.         self.month = month
  7.         self.day = day
  8.  
  9.     @classmethod
  10.     def today(cls):
  11.         t = datetime.datetime.now()
  12.         return cls(t.year, t.month, t.day)
  13.  
  14. d = Date.today()
  15. print(f"{d.day}/{d.month}/{d.year}")
Advertisement
Add Comment
Please, Sign In to add comment