Get week number using date in python
Date is datetime.date(2013, 12, 30) I am trying to get week number using import datetime datetime.date(2013, 12, 30).isocalendar()[1] I am getting output as , 1 Why i am not getting week number of last year , instead i am getting week number of current year? Whats wrong i am doing here ? You are doing nothing wrong, 2013/12/30 falls in week 1 of 2014, according to the ISO8601 week numbering standard : The ISO 8601 definition for week 01 is the week with the year's first Thursday in it. The Thursday in that week is 2014/01/02. Other ways to explain the definition, from the same linked WikiPedia