Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python array of last n months

x = 10 #N Months
now = time.localtime()
print([time.localtime(time.mktime((now.tm_year, now.tm_mon - n, 1, 0, 0, 0, 0, 0, 0)))[:2] for n in range(x)])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #array #months
ADD COMMENT
Topic
Name
1+7 =