-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviordatetime 📆
Description
When outputting a date with a year before 1000, there may be a difference in OS in whether there are leading zeroes in the string representation.
library(tidyverse)
as.Date("0020-02-13")
format_csv(tibble(x = as.Date("0020-02-13")))My Windows
# [1] "0020-02-13"
# [1] "x\n0020-02-13\n"My Linux
# [1] "20-02-13"
# [1] "x\n20-02-13\n"I understand that it is hard to account for every OS-specific quirk, but readr itself does not by default guess that "20-02-13" is a date.
Would something like this (probably a Base R variant instead) work?
output_column.Date <- function(x, name){
str_pad(as.character(x), 10, pad = "0")
}Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviordatetime 📆