flutterdatetimesystem

How do I check if the system date is correct in flutter? Any package or API


Is there any way to check if the system DateTime is correct or not in Flutter? I tried searching for APIs which provide current DateTime, but the problem with timezones happens again. What is the solution for this? (I want to do something like WhatsApp. which is, don't give chatting access if system DateTime is wrong)


Solution

  • simple solution, use unix epoch time

    print(DateTime.now().millisecondsSinceEpoch);