r - What is the correct date format for writexl -


what correct date format new writexl package? tried on lubridate dates, , resulting excel spreadsheet contains strings of form yyyy-mm-dd (i.e. not excel dates).

the purpose of writexl package create mirror image of r table in excel file format. having data in 1 of usual r date/time formats as.date, as.posixct, etc. won't translate date format shifting yyyy-mm-dd d/m/y while being exported excel. if you'd in more standard excel date/time format in excel file, it's best convert prior exporting strftime() function, this:

require(writexl)  write_xlsx(   data.frame(date=strftime(c("2017-09-10","2017-09-11","2017-09-12"),"%d/%m/%y")),   "~/downloads/mydata.xlsx") 

output (in xlsx file):

date 10/09/17 11/09/17 12/09/17 

edit:

if you'd data excel date format once it's in new file, adding as.posixct() above ensure that.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -