From 504662128671884f6d5640e7ffd78d25b7bb38ba Mon Sep 17 00:00:00 2001 From: iraida07 Date: Mon, 11 May 2020 18:22:31 -0500 Subject: [PATCH] =?UTF-8?q?:sparkles:=20Se=20implementa=20decorador=20'fin?= =?UTF-8?q?ish=5Fdate'=20y=20se=20da=20soluci=C3=B3n=20al=20reto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- challenge.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/challenge.py b/challenge.py index c69287d..34c94a7 100644 --- a/challenge.py +++ b/challenge.py @@ -1,8 +1,13 @@ import time -def finish_date(): - # You have to code here!! +def finish_date(func): + def add_date(*args, **kwargs): + func(*args, **kwargs) + local_time = time.localtime() + formated_time = time.strftime("%d/%m/%Y - %H:%M:%S", local_time) + print(f'The function {func.__name__} ends at:{formated_time}') + return add_date @finish_date