I'm trying to format a DateTime
object to a String
by using the Dates.format()
function.
I'd like to get the week number for a specific time, however I can't find right formatting option in the docs.
I know I could get this by running Dates.week
but I would really like to know if it's possible via format
to have cleaner code (and crack a code golfing challenge...).
Here's some actual code:
julia> my_time = now()
2018-03-22T08:16:15.601
julia> Dates.week(my_time)
12
julia> Dates.format(my_time, "Y m d H:M:S")
"2018 3 22 8:16:15"
In R, I could do "%V" to get the weeks formatted. Is there a similar way in Julia?