世界时间api

void getData() async{
Response response= await get('http://worldtimeapi.org/api/timezone/America/Los_Angeles');
Map datetime = jsonDecode(response.body);
String time =datetime['datetime'];
String utc = datetime['utc_offset'].substring(0,3);
//创建时间对象
DateTime now =DateTime.parse(time).add(Duration(hours:int.parse(utc)));
print(now);
}