I have created a flutter app and I need the time for calculating future but cannot get actual time i.e. DateTime.timestamp() showing the time 11:23
but in device showing the time 15:51
my device is Galaxy A20s.
I have created a flutter app and I need the time for calculating future but cannot get actual time i.e. DateTime.timestamp() showing the time 11:23
but in device showing the time 15:51
my device is Galaxy A20s.
2
Answers
You can use this for current time, I hope this may help you.
This gets me the right value, including timezone offset:
You may have to change the
DateFormat
for your locale.