如何在Dart中格式化时间?

I tried to build an application wich should give out the local time from Vienna. I formated the time with time = DateFormat.jm().format(), but now I get a time like 14:25 PM. How can I delet the PM, because I don´t need it? This is the code I tried:

class _MyHomePageState extends State<MyHomePage> {
  void getTime() async {
    String time;

    Response response =
        await get("http://worldtimeapi.org/api/timezone/Europe/Vienna");
    Map data = jsonDecode(response.body);

    String datetime = data["datetime"];
    String offset = data["utc_offset"].substring(1, 3);
    DateTime now = DateTime.parse(datetime);
    now = now.add(Duration(hours: int.parse(offset)));
    time = DateFormat.jm().format(now);
    print(time);
  }

这是我得到的时间:

I/flutter ( 9302): 12:43 PM
评论