In the Julia 1.0 documentation for the Dates package it says for the Dates.dayofweek
function:
"Return the day of the week as an Int64 with 1 = Monday, 2 = Tuesday, etc.."
Example from documentation after adding using Dates
:
julia> using Dates
julia> Dates.dayofweek(Date("2000-01-01"))
6
Example for Monday, 9/10/2018:
julia> Dates.dayofweek(Date("2018-09-10"))
1
I do not see a way to set Sunday=1, Monday=2, etc.
Any suggestions?
EDIT: The accepted answer works great and is illustrated below in contrast to the code above:
julia> my_dayofweek(Date("2018-09-10"))
2
This functionality is hard coded. Therefore I guess that what you can do is define your own function for this:
my_dayofweek(x) = dayofweek(x + Day(1))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With