"structs give the same results via Arrow"
"nested lists of atomic values can be written"
"nested and packed columns work in full"

Expected `rel_to_altrep(rel5)` to be identical to `expected`.
Differences:
  `attr(actual, 'row.names')`: NA -2
`attr(expected, 'row.names')`:  1  2

test_that("timezone_out works with default", {
test_that("timezone_out works with UTC specified", {
test_that("timezone_out works with a specified timezone", {
con <- local_con(timezone_out = "Pacific/Tahiti")
expect_equal(res[[1]], as.POSIXct("1970-01-01 02:00:00", tz = "Pacific/Tahiti"))
test_that("timezone_out works with '' and converts to local timezime", {
expect_equal(res[[1]], as.POSIXct("1970-01-01 02:00:00", tz = "Pacific/Tahiti"), ignore_attr = TRUE)
test_that("timezone_out works with Sys.timezone", {
con <- local_con(timezone_out = Sys.timezone())
test_that("timezone_out works with UTC and tz_out_convert = 'force'", {
con <- local_con(timezone_out = "UTC", tz_out_convert = "force")
test_that("timezone_out works with a specified timezone and tz_out_convert = 'force'", {
con <- local_con(timezone_out = "Pacific/Tahiti", tz_out_convert = "force")
expect_equal(res[[1]], as.POSIXct("1970-01-01 12:00:00", tz = "Pacific/Tahiti"))
test_that("timezone_out works with '' and tz_out_convert = 'force': forces local timezime", {
con <- local_con(timezone_out = "", tz_out_convert = "force")
expect_equal(res[[1]], as.POSIXct("1970-01-01 12:00:00", tz = "Pacific/Tahiti"), ignore_attr = TRUE)
test_that("timezone_out works with a specified local timezone and tz_out_convert = 'force': forces local timezime", {
con <- local_con(timezone_out = Sys.timezone(), tz_out_convert = "force")
test_that("timezone_out gives a warning with invalid timezone, and converts to UTC", {
expect_warning(con <- local_con(timezone_out = "not_a_timezone"))
test_that("timezone_out gives a warning with NULL timezone, and converts to UTC", {
expect_warning(con <- local_con(timezone_out = NULL))
test_that("dbConnect fails when tz_out_convert is misspecified", {
test_that("timezone_out and tz_out_convert = force with midnight times (#8547)", {
con <- local_con(timezone_out = "Etc/GMT+8", tz_out_convert = "force")
"CREATE TABLE IF NOT EXISTS test( DATE_TIME TIMESTAMP );"
res <- dbGetQuery(con, "SELECT * FROM test;")
test_that("POSIXct with local time zone", {
df1 <- data.frame(a = structure(1745781814.84963, class = c("POSIXct", "POSIXt")))
test_that("POSIXct with local time zone and existing but empty attribute", {
test_that("tz_out_convert = force handles invalid timestamps during DST transitions", {
# This test reproduces the issue where invalid timestamps during DST transitions
# cause all timestamps to lose their time component when tz_out_convert = "force"
con <- local_con(timezone_out = "Europe/London", tz_out_convert = "force")
expected1 <- as.POSIXct("2025-03-30 00:59:00", tz = "Europe/London")
# Test with mixed valid and invalid timestamps
# 2025-03-30 01:00:00 does not exist in Europe/London (DST transition)
# The first timestamp should remain valid with full time information
# The second should be NA (not stripped to date only)
expected2 <- tz_force_one(timezone = "Europe/London", c(