Pre-allocating a DateTime vector

In a prior post, 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?

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

should work

3 Likes