我使用TimePicker获取开始时间和结束时间。我在数据模型中使用DateTime对象。像这样将TimeOfDay转换为DateTime
DateTime newTime = new DateTime(
startTime.year,
startTime.month,
startTime.day,
picked.hour,
picked.minute);
我使用此表格打印
DateFormat timeFormat = new DateFormat("hh:mm a");
但是newTime的分钟始终为05。DateTime.now()也将分钟打印为05,例如12:05 PM。
我正在尝试使用错误的DateFormatter打印
使用中
DateFormat timeFormat = new DateFormat("hh:mm a");
而不是
DateFormat timeFormat = new DateFormat.jm();