如何将日落/日出数据转换为颤振时间
{"type":1,"id":9052,"country":"IN","sunrise":1628470082,"sunset":1628516419},"timezone":19800
如何在这里转换这些数据:Map setrise = data['sys'];
Map setrise = data['sys'];
int getsunrise = setrise['sunrise'];
int getsunset = setrise['sunset'];
//getting timezone
int getTimezone = data['timezone'];
其中data为API响应图
试试这个代码
DateTime.fromMillisecondsSinceEpoch(apisunsettime * 1000),