Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import datetime
- class Date:
- def __init__(self, year, month, day):
- self.year = year
- self.month = month
- self.day = day
- @classmethod
- def today(cls):
- t = datetime.datetime.now()
- return cls(t.year, t.month, t.day)
- d = Date.today()
- print(f"{d.day}/{d.month}/{d.year}")
Advertisement
Add Comment
Please, Sign In to add comment