擅长:python、mysql、java
<p>感谢您的建议,我们按照@LeeGarcon的建议编写了一个函数并遍历了json文档。成功了!你知道吗</p>
<pre><code>import re
import datetime
def _epoch_to_datetime(_dict_element):
""" This function expects a dictionary (k,v) """
pattern = "^/Date..............."
for k,v in _dict_element.items():
if re.match(pattern,str(v)):
epoch_time = v[6:-5]
_dict_element[k] = datetime.datetime.fromtimestamp(int(epoch_time)).strftime('%Y-%m-%d %H:%M:%S')
</code></pre>