How to convert text dates to excel dates

Hi, I have an R script that imports a couple of csv files, merges them and does all sorts of manipulations. Mostly i use SQLDF (sqlite) as I am a competent SQL coder and not yet competent in R.
All this works fine apart from the date fields which output as text. Sqlite doesn't have a date type. This causes a problem as the PowerQuery that then imports the output from my R program expects dates to be numerics.

I have found how to convert excel dates numbers to dates in R, using, but I need the opposite.

Any ideas?



Something like this?

I use the janitor package. It has specific functions to deal with excel dates.
The convert_to_date() will do exactly that.

[](http://Link to janitor function documentation.)


Hi William, That looks like the kind of thing I was after. Thanks Andrew

That looks interesting. I will look into it. Cheers Andrew

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.