flutter中日期的比较比较方便,可以通过difference方法来实现,示例代码如下: //出生日期 final birthday = DateTime(1988, 10, 12); //当前日期 final date2 = DateTime.now(); //比较相差的天数 final difference = date2.difference(birthday).inDays;
Powered by: 博客园 Copyright © 2024 诗意的活着 Powered by .NET 9.0 on Kubernetes