Wed, 20 Nov 2013 13:53:35 GMT
def get_days_left_in_month(from_date): # todo : how to validate if from_date is valid? start_day, end_day = Day.get_start_end_days_for_year_and_month( from_date.year, from_date.month ) remaining_days = (end_day - from_date).days return remaining_days if remaining_days == 0 else remaining_days - 1
如何使用python执行此操作?
答案 0 :(得分:0)
试试这个
import time
a = "Wed, 20 Nov 2013 13:53:35 GMT"
time.strptime(a, "%a, %d %b %Y %H:%M:%S %Z")
并查看可用格式的here。