Home > database >  How to Add( ) 30 minutes to the DateTime.now in flutter
How to Add( ) 30 minutes to the DateTime.now in flutter

Time:10-18

So basically I have an access token that expires in 300 seconds, I need to add 30 minutes to the current date time and save that date time to check whether the access token is expired or not

CodePudding user response:

You can use add() to add some time to DateTime, like this:

var result = DateTime.now().add(Duration(minutes: 30));
print("now   30 min = ${result}");
  • Related