后台返回这个时间格式“2018年7月9日”,怎么转为“2018-07-09”或者标准格式呢?
1 回答
![?](http://img1.sycdn.imooc.com/5458689e000115c602200220-100-100.jpg)
守着星空守着你
TA贡献1799条经验 获得超8个赞
string time='2018年7月9号';
string time2= time.replace('年',‘-’) .replace('月',‘-’) .replace('日',‘-’) ;
添加回答
举报
0/150
提交
取消