Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       final String currentTimeZone = await FlutterNativeTimezone.getLocalTimezone();
  2.       final localTZ = getLocation(currentTimeZone);
  3.       print(currentTimeZone);
  4.  
  5.       TZDateTime currentDateTime = TZDateTime.now(localTZ);
  6.       TZDateTime deliveryDateTime = TZDateTime.parse(UTC, widget.delivery['shipment_workflow_due_date'] + " " +         widget.delivery['shipment_workflow_due_time']);
  7.  
  8.       print("Workflow " + widget.delivery['shipment_workflow_due_date'] + widget.delivery['shipment_workflow_due_time']);
  9.       print("Delivery Date Time in UTC: " + deliveryDateTime.toString());
  10.  
  11.       DateTime localDeliveryDateTime = new TZDateTime.from(deliveryDateTime, localTZ);
  12.      
  13.       print("Converted Delivery Date in Local: " + localDeliveryDateTime.toString());
  14.       print("Difference: " + localDeliveryDateTime.difference(deliveryDateTime).toString());
  15.       print("Current Local Time" + currentDateTime.toString());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement