class Utils { static String getFriendDate(DateTime time) { var currentTime = DateTime.now(); var timeDelta = currentTime.millisecondsSinceEpoch - time.millisecondsSinceEpoch; if (timeDelta <= 86400) { return "刚刚更新"; } String timeStr = "${time.month}月${time.day}日"; if (time.year != currentTime.year) { timeStr = "${time.year}年$timeStr"; } return timeStr; } }