# Pre-allocating a DateTime vector

**URL:** <https://discourse.julialang.org/t/pre-allocating-a-datetime-vector/57949>\
**Category:** New to Julia\
**Created:** [March 25, 2021, 4:27pm UTC](https://discourse.julialang.org/t/pre-allocating-a-datetime-vector/57949 "2021-03-25T16:27:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nash](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nash/32/14482_2.png) [@Nash](https://discourse.julialang.org/u/Nash)\
**Post date:** [March 25, 2021, 4:27pm UTC](https://discourse.julialang.org/t/pre-allocating-a-datetime-vector/57949/1 "2021-03-25T16:27:18Z")

</div>

In a prior [post](https://discourse.julialang.org/t/pre-allocate-datetime-array-how/1028), the following was suggested to preallocate a DateTime vector with 100 rows:

```
sDate = Vector{DateTime}(100)

```

Unfortunately, that doesn’t work on my system. What am I missing?

---

<div class="post-metadata">

**Author:** ![MLackner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mlackner/32/2789_2.png) [@MLackner](https://discourse.julialang.org/u/MLackner)\
**Post date:** [March 25, 2021, 4:32pm UTC](https://discourse.julialang.org/t/pre-allocating-a-datetime-vector/57949/2 "2021-03-25T16:32:36Z")

</div>

```julia
using Dates
sDate = Vector{DateTime}(undef, 100)

```

should work
