-2
我有兩個日期爲字符串:如何從日期(字符串)範圍創建字典?
start = '2015-01-01'
end = '2015-03-23'
我想創建這樣的dict(我用OrderedDict):
date_dict = {
'2015-01-01': [something],
'2015-01-02': [something],
'2015-01-03': [something],
'2015-01-04': [something],
[...]
'2015-03-22': [something],
'2015-03-23': [something],
}
如何從這個兩個字符串鍵?
http://stackoverflow.com/a/7274316/4907653 – f43d65
是你的日期始終保存爲字符串? –