Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97327

How can I get the difference between 2 times in FLUTTER?

$
0
0

I'm working on a flutter app as a project and actually I'm stuck with how to get the difference between two times. The first one I'm getting it from firebase as a String then I format it to DateTime using this DateTime.parse(snapshot.documents[i].data['from']) and it gives me like 14:00 for example. Then, the second is DateTime.now(). I tried all methods difference, substract... but nothing works!

Please help me to get the exact duration between those 2 times.

TY

PS: I need this for a Count Down Timer


Viewing all articles
Browse latest Browse all 97327

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>