>>> a='2015-6-9'
>>> datetimeObj = time.strptime(a, "%Y-%m-%d")
>>> datetimeObj
(2015, 6, 9, 0, 0, 0, 1, 160, -1)
>>> time.strftime("%Y%m%d",datetimeObj)
'20150609'
>>> a='2015-6-9'
>>> datetimeObj = time.strptime(a, "%Y-%m-%d")
>>> datetimeObj
(2015, 6, 9, 0, 0, 0, 1, 160, -1)
>>> time.strftime("%Y%m%d",datetimeObj)
'20150609'