Skip to content

Commit

Permalink
ensure timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkliming committed Sep 28, 2024
1 parent 1b6ec61 commit cc386c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,12 @@ listing_format_chevron <- function() {
#' @export
#' @examples
#' format_date("%d%b%Y")(as.Date("2021-01-01"))
#' format_date("%d%b%Y")(as.POSIXct("2021-01-01 00:00:01", tz = "NZ"))
#' format_date("%d%b%Y")(as.POSIXct("2021-01-01 00:00:01", tz = "US/Pacific"))
#' if ("NZ" %in% OlsonNames()) {
#' format_date("%d%b%Y")(as.POSIXct("2021-01-01 00:00:01", tz = "NZ"))
#' }
#' if ("US/Pacific" %in% OlsonNames()) {
#' format_date("%d%b%Y")(as.POSIXct("2021-01-01 00:00:01", tz = "US/Pacific"))
#' }
format_date <- function(date_format = "%d%b%Y") {
function(x, ...) {
toupper(
Expand Down
8 changes: 6 additions & 2 deletions man/format_date.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cc386c0

Please sign in to comment.