File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
main/java/com/google/cloud/spanner/pgadapter/session
test/java/com/google/cloud/spanner/pgadapter Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -458,6 +458,9 @@ static String convertToValidZoneId(String value) {
458458 if ("utc" .equalsIgnoreCase (value )) {
459459 return "UTC" ;
460460 }
461+ if ("localtime" .equalsIgnoreCase (value )) {
462+ return ZoneId .systemDefault ().getId ();
463+ }
461464 for (String zoneId : ZoneId .getAvailableZoneIds ()) {
462465 if (zoneId .equalsIgnoreCase (value )) {
463466 return zoneId ;
Original file line number Diff line number Diff line change @@ -2956,6 +2956,16 @@ public void testSetTimeZoneToServerDefault() throws SQLException {
29562956 }
29572957 }
29582958
2959+ @ Test
2960+ public void testSetTimeZoneToLocaltime () throws SQLException {
2961+ try (Connection connection = DriverManager .getConnection (createUrl ())) {
2962+ connection .createStatement ().execute ("set time zone 'atlantic/jan_mayen'" );
2963+ verifySettingValue (connection , "timezone" , "Atlantic/Jan_Mayen" );
2964+ connection .createStatement ().execute ("set time zone localtime" );
2965+ verifySettingValue (connection , "timezone" , TimeZone .getDefault ().getID ());
2966+ }
2967+ }
2968+
29592969 @ Test
29602970 public void testSetTimeZoneToDefault () throws SQLException {
29612971 try (Connection connection =
You can’t perform that action at this time.
0 commit comments