0.7.0 Dates: how to dsipaly only values , without "days" for diff()?

0.7.0 Dates: how to dsipaly only values , without “days” for diff() ? (diff(daty)).value not works.

julia> (Date.(dane[1,1])-Date.(dane[4,1])).value
-90

julia> (diff(daty)).value
ERROR: type Array has no field value
Stacktrace:
[1] getproperty(::Any, ::Symbol) at .\sysimg.jl:18

julia> (diff(daty))
95-element Array{Day,1}:
31 days
28 days
31 days
30 days
Paul

Dates.value should do it.

I like to use Day(20) / Day(1). It’s more consistent, unit-wise, than Dates.value.

1 Like

Yesss…
Dates.value.(diff(daty))
works!
Thx, Paul

Day(20) ÷ Day(1) is slightly better because it preserves the Integer type.

2 Likes