From 9a26d9b0fa214a42efab3b97967031ef91ce40cd Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Sat, 7 Nov 2026 10:15:38 -0600 Subject: [PATCH 1/2] Format progress timestamps in UTC `format_iso_8601()` labelled timestamps `+00:00` but formatted them in local time. The logger test also used the legacy `CET` zone, which isn't available on current Ubuntu runners. --- NEWS.md | 2 ++ R/utils.R | 2 +- tests/testthat/_snaps/progress-handler-logger.md | 2 +- tests/testthat/test-progress-handler-logger.R | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 613813199..a86353d25 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,8 @@ seconds (configurable with `cli.progress_llm_interval`), plus a final line. This is implemented by the new `llm` progress handler. +* The `logger` progress handler and the `pb_timestamp` progress variable now report timestamps in UTC, matching their `+00:00` suffix. Previously they used local time. + * New `cli_extract_vars()` function to extract variable and function names from cli format strings without evaluating them (#750, @MichaelChirico). diff --git a/R/utils.R b/R/utils.R index 7e2cf22a0..03f855174 100644 --- a/R/utils.R +++ b/R/utils.R @@ -3,7 +3,7 @@ is_yes <- function(x) { } format_iso_8601 <- function(p) { - format(p, "%Y-%m-%dT%H:%M:%S+00:00") + format(p, "%Y-%m-%dT%H:%M:%S+00:00", tz = "UTC") } has_packages <- function(pkgs) { diff --git a/tests/testthat/_snaps/progress-handler-logger.md b/tests/testthat/_snaps/progress-handler-logger.md index ad33c9829..03b06edc4 100644 --- a/tests/testthat/_snaps/progress-handler-logger.md +++ b/tests/testthat/_snaps/progress-handler-logger.md @@ -3,5 +3,5 @@ Code logger_out(bar, "updated") Output - 2021-06-10T13:51:05+00:00 id 13/113 updated + 2021-06-10T11:51:05+00:00 id 13/113 updated diff --git a/tests/testthat/test-progress-handler-logger.R b/tests/testthat/test-progress-handler-logger.R index 74f378df9..bd858421f 100644 --- a/tests/testthat/test-progress-handler-logger.R +++ b/tests/testthat/test-progress-handler-logger.R @@ -3,6 +3,6 @@ test_that("loggerr_out", { bar$id <- "id" bar$current <- 13 bar$total <- 113 - local_mocked_bindings(Sys.time = function() .POSIXct(1623325865, tz = "CET")) + local_mocked_bindings(Sys.time = function() .POSIXct(1623325865, tz = "Europe/Berlin")) expect_snapshot(logger_out(bar, "updated")) }) From aae322e824f797b550e2b489482a524a91a3608c Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Sat, 7 Nov 2026 10:16:13 -0600 Subject: [PATCH 2/2] Apply suggestion from @github-actions[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- tests/testthat/test-progress-handler-logger.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-progress-handler-logger.R b/tests/testthat/test-progress-handler-logger.R index bd858421f..f4932d8f6 100644 --- a/tests/testthat/test-progress-handler-logger.R +++ b/tests/testthat/test-progress-handler-logger.R @@ -3,6 +3,8 @@ test_that("loggerr_out", { bar$id <- "id" bar$current <- 13 bar$total <- 113 - local_mocked_bindings(Sys.time = function() .POSIXct(1623325865, tz = "Europe/Berlin")) + local_mocked_bindings(Sys.time = function() { + .POSIXct(1623325865, tz = "Europe/Berlin") + }) expect_snapshot(logger_out(bar, "updated")) })