Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Date formatting a data frame string column

Tags:

julia

Is there a way to do something like this (this is in R)

df$dataCol <- as.Date(df$dataCol, format="%Y%m%d")

where the dataCol is of the format "20151009".

  1. Is there a way to change the column type to date in julia ?
  2. I didnt find a way to do this with the Date.jl package.
like image 298
ajkl Avatar asked Oct 19 '22 21:10

ajkl


1 Answers

There is a Date constructor with an argument for the format, but the syntax is slightly different.

using Dates
Date( "20141123", DateFormat("yyyymmdd") )
like image 101
Vincent Zoonekynd Avatar answered Oct 22 '22 21:10

Vincent Zoonekynd