Georgery
Georgery

Reputation: 8117

Convert Days to Integer in Julia

I have a duration

Day(42)

How can I convert it to an Int64?

I have one solution, but is there other smart ways to do it?

Upvotes: 1

Views: 508

Answers (1)

Georgery
Georgery

Reputation: 8117

The Dates package contains the value function for this.

Day(42) |> Dates.value

Upvotes: 2

Related Questions