这是不可能的。 仅
TimeOfDay保留小时和分钟。而a 也有日/月/年 __
DateTime
如果要转换,您将需要更多信息。如当前的DateTime。然后将两者合并为一个最终日期时间。
TimeOfDay t;final now = new DateTime.now();return new DateTime(now.year, now.month, now.day, t.hour, t.minute);

这是不可能的。 仅
TimeOfDay保留小时和分钟。而a 也有日/月/年 __
DateTime
如果要转换,您将需要更多信息。如当前的DateTime。然后将两者合并为一个最终日期时间。
TimeOfDay t;final now = new DateTime.now();return new DateTime(now.year, now.month, now.day, t.hour, t.minute);