Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/fecha.py
diff options
context:
space:
mode:
authoryaderv <yajosev@gmail.com>2011-03-14 18:21:08 (GMT)
committer yaderv <yajosev@gmail.com>2011-03-14 18:21:08 (GMT)
commitc3fe565683236c9c0f738af0120c1c589b1c4e2a (patch)
tree645718cc2c2ddb98b44974e6fbfe0ca8ffde2172 /fecha.py
parentaf6acfa8328f11bb0f521f84567bcbbf35a585b4 (diff)
numero de la semana done
Diffstat (limited to 'fecha.py')
-rw-r--r--fecha.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/fecha.py b/fecha.py
index aad0883..afe76ab 100644
--- a/fecha.py
+++ b/fecha.py
@@ -16,7 +16,7 @@
#along with this program. If not, see <http://www.gnu.org/licenses/>.
from time import localtime, strftime, mktime
-from datetime import datetime
+from datetime import datetime, date
from gettext import gettext as _
class FechaUnix(object):
@@ -43,17 +43,20 @@ class FechaNormal(object):
'''Get, convert and return dates in our popular format'''
def __init__(self):
'''init of FechaNormal'''
+ self.fecha = datetime.today()
def fecha_actual(self):
'''return the actual date such as
day of month of year'''
- self.fecha = datetime.today()
return self.fecha.strftime("%d de %B de %Y")
def fecha_especial(self):
'''special format of a date for
be use it like a dicctionary key
in the format day/month/year'''
- self.fecha = datetime.today()
return self.fecha.strftime("%d/%m/%y")
-
+ def numero_semana(self):
+ '''return the number of the current week'''
+ self.esta_semana = date.today()
+ self.semana = date.isocalendar(self.esta_semana)
+ return int(self.semana[1])