Skip to content

Commit eae7eea

Browse files
authored
Merge pull request #5 from madanneelapu/patch-1
have to consider the + or - of the offset as well
2 parents 79b7b67 + 9b33c9e commit eae7eea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

world_time_app/lib/services/world_time.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class WorldTime {
2121

2222
// get properties from json
2323
String datetime = data['datetime'];
24-
String offset = data['utc_offset'].substring(1,3);
24+
String offset = data['utc_offset'].substring(0,3);
2525

2626
// create DateTime object
2727
DateTime now = DateTime.parse(datetime);
@@ -38,4 +38,4 @@ class WorldTime {
3838

3939
}
4040

41-
}
41+
}

0 commit comments

Comments
 (0)