Skip to content

Commit 558f2ef

Browse files
author
Isaque Neves
committed
fix define location for TZDateTime.toLocal()
1 parent 0b1e037 commit 558f2ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/src/types/binary_codec.dart

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'dart:typed_data';
33

44
import 'package:buffer/buffer.dart';
55
import 'package:pg_timezone/pg_timezone.dart' as tz;
6+
import 'package:pg_timezone/timezone.dart' as tzenv;
67
import 'package:postgres/src/types/generic_type.dart';
78

89
import '../buffer.dart';
@@ -839,6 +840,8 @@ class PostgresBinaryDecoder {
839840
'Location with the name "$pgTimeZone" doesn\'t exist');
840841
}
841842
final tzLocation = tzLocations.first;
843+
//define location for TZDateTime.toLocal()
844+
tzenv.setLocalLocation(tzLocation);
842845

843846
final offsetInMilliseconds = tzLocation.currentTimeZone.offset;
844847
// Conversion of milliseconds to hours

0 commit comments

Comments
 (0)