# Handling Dates

**URL:** <https://discourse.julialang.org/t/handling-dates/106879>\
**Category:** General Usage\
**Tags:** question, dates\
**Created:** [November 29, 2023, 6:28am UTC](https://discourse.julialang.org/t/handling-dates/106879 "2023-11-29T06:28:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sourish](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sourish/32/34156_2.png) [@Sourish](https://discourse.julialang.org/u/Sourish)\
**Post date:** [November 29, 2023, 6:28am UTC](https://discourse.julialang.org/t/handling-dates/106879/1 "2023-11-29T06:28:08Z")

</div>

Hi

I am trying to convert a string to date with the following code - but giving me some parsing error

```julia
using Dates
df = DateFormat("d-b-y");
dt = Date("28-Feb-99",df)

```

I am getting the following error:

```julia
ArgumentError: Unable to parse date time. Expected directive Delim(-b-) at char 3

```

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [November 29, 2023, 6:49am UTC](https://discourse.julialang.org/t/handling-dates/106879/2 "2023-11-29T06:49:12Z")

</div>

```julia
julia> Date("28-Feb-99",dateformat"d-u-y")
0099-02-28

```

See the [date format spec](https://docs.julialang.org/en/v1/stdlib/Dates/#Dates.DateFormat)

and this bug

> <https://github.com/JuliaLang/julia/issues/40532>
>
> As discussed in https://discourse.julialang.org/t/posix-month/58572, Unix, Posix…, Python, and R agree that U and u mean week, not month. In Julia's \[Dates\](https://docs.julialang.org/en/v1/stdlib/Dates/) they mean month. I think Julia should use the common abbreviations here. I'm not sure how to handle backward compatibility though.

---

<div class="post-metadata">

**Author:** ![Sourish](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sourish/32/34156_2.png) [@Sourish](https://discourse.julialang.org/u/Sourish)\
**Post date:** [November 29, 2023, 7:01am UTC](https://discourse.julialang.org/t/handling-dates/106879/3 "2023-11-29T07:01:37Z")

</div>

Thanks for your reply. Does this mean it is still a bug? Also why the year is showing `0099`?

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [November 29, 2023, 7:04am UTC](https://discourse.julialang.org/t/handling-dates/106879/4 "2023-11-29T07:04:48Z")

</div>

> [@Sourish](#):
>
> Does this mean it is still a bug?

It’s debatable whether it’s technically a “bug” but it would be breaking to change it before Julia 2.0 so we’re stuck with it for now.

> [@Sourish](#):
>
> Also why the year is showing `0099`

Your date says year `99` and it doesn’t want to guess which century you mean. You can add `+ Year(1900)` if you want.

---

<div class="post-metadata">

**Author:** ![Sourish](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sourish/32/34156_2.png) [@Sourish](https://discourse.julialang.org/u/Sourish)\
**Post date:** [November 29, 2023, 8:44am UTC](https://discourse.julialang.org/t/handling-dates/106879/5 "2023-11-29T08:44:10Z")

</div>

Oh - that’s bad - but hey thank you for your help 🙂
