I want to get the time right now in cairo but the timezone package give me the device date why ?
DateTime returnCommonDate(){
tz.initializeTimeZones();
final egyptTimeZone =
tz.getLocation('Africa/Cairo');
final now =
tz.TZDateTime.now(egyptTimeZone);
print"his is egypt time ${now}");
return now;
}
Try using the toLocal() function of the "timezone" package:
tz.TZDateTime.now(egyptTimeZone).toLocal()