Найти - Пользователи
Полная версия: какая-какая неделя? datetime.now().strftime("%W")
Начало » Python для новичков » какая-какая неделя? datetime.now().strftime("%W")
1
hildi
Сегодня с утра (вроде бы :-) началась 37-я календарная неделя, а питон говорит, что 36-я.
Это так и надо?

import datetime
datetime.datetime.now().strftime("%W")
'36'
Ed
Судя вот по этому описалову из стандартной документации:
Week number of the year (Monday as the first day of the week) as a decimal number . All days in a new year preceding the first Monday are considered to be in week 0.
первая неделя началась 5.01.2009.
hildi
Ed
Судя вот по этому описалову из стандартной документации:
Week number of the year (Monday as the first day of the week) as a decimal number . All days in a new year preceding the first Monday are considered to be in week 0.
первая неделя началась 5.01.2009.
Спасибо!
pasaranax
Еще бы дни месяца с нуля считали )
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB