Hey,
I cannot find a solution to convert DOY to date, for example
Date("2021-146", "yyyy-ddd")
is not working.
Any ideas?
Thanks Bjoern
Hey,
I cannot find a solution to convert DOY to date, for example
Date("2021-146", "yyyy-ddd")
is not working.
Any ideas?
Thanks Bjoern
There isn’t currently a format character for parsing the DOY, but you can pretty easily work around this by using the builtin Date + Period math:
julia> Date("2021") + Day(146)
2021-05-27
Date("2021")
will parse as 2021-01-01
, then you’re adding 146 Day
s to that date.
And so if you just have to work directly from the string ds = "2021-146"
, you can then do:
Date(split(ds,"-")[1]) + Day(split(ds,"-")[2])
I think it should be
julia> Date("2021") + Day(145)
2021-05-26