# Date function to DataFrame

**URL:** <https://discourse.julialang.org/t/date-function-to-dataframe/24807>\
**Category:** New to Julia\
**Created:** [May 31, 2019, 6:54pm UTC](https://discourse.julialang.org/t/date-function-to-dataframe/24807 "2019-05-31T18:54:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BMval](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bmval/32/7647_2.png) [@BMval](https://discourse.julialang.org/u/BMval)\
**Post date:** [May 31, 2019, 6:54pm UTC](https://discourse.julialang.org/t/date-function-to-dataframe/24807/1 "2019-05-31T18:54:25Z")

</div>

Hello.  
Would somebody help me?  
I am a dataframe. one of the columns is Date.  
I need to round all Dates to month. I know how it to do for one variable. But how it can be don for the column from DataFrame.  
something like this:

> round(df.Date,Dates.Month)

---

<div class="post-metadata">

**Author:** ![alejandromerchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alejandromerchan/32/10500_2.png) [@alejandromerchan](https://discourse.julialang.org/u/alejandromerchan)\
**Post date:** [May 31, 2019, 7:09pm UTC](https://discourse.julialang.org/t/date-function-to-dataframe/24807/2 "2019-05-31T19:09:16Z")

</div>

You probably need broadcasting

```julia
round.(df.Date,Dates.Month)

```

At this moment I can’t confirm if that works.

---

<div class="post-metadata">

**Author:** ![BMval](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bmval/32/7647_2.png) [@BMval](https://discourse.julialang.org/u/BMval)\
**Post date:** [May 31, 2019, 7:11pm UTC](https://discourse.julialang.org/t/date-function-to-dataframe/24807/3 "2019-05-31T19:11:32Z")

</div>

Thank you.  
It works.

---

<div class="post-metadata">

**Author:** ![alejandromerchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alejandromerchan/32/10500_2.png) [@alejandromerchan](https://discourse.julialang.org/u/alejandromerchan)\
**Post date:** [May 31, 2019, 7:19pm UTC](https://discourse.julialang.org/t/date-function-to-dataframe/24807/4 "2019-05-31T19:19:26Z")

</div>

Good to hear, you should mark it as solved for future reference.
