i’m using my backup script since 2011 and had no problems at all. But since start of 2013 I’m getting problem with the correct week number.
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.strftime("%W", time.localtime())
'02'
But we have week number 3
Am i doing something wrong? It was working till 2013.
Thanks.
All days in a new year preceding the first Monday are considered to be in week 0.docs
Take a look at the calendar:
In the standard library you can use use
datetime.isocalendar():