tests/testthat/test-utils.R

test_that("parse_timestamp parses ISO 8601 UTC timestamps", {
  x = parse_timestamp(c("2024-01-02T03:04:05Z", "2024-01-02T03:04:05.5Z", NA))
  expect_s3_class(x, "POSIXct")
  expect_identical(attr(x, "tzone"), "UTC")
  expect_equal(x, as.POSIXct(c("2024-01-02 03:04:05", "2024-01-02 03:04:05.5", NA), tz = "UTC"))
})

Try the bbk package in your browser

Any scripts or data that you put into this service are public.

bbk documentation built on Oct. 21, 2026, 5:14 p.m.