For users
apply_ufunc
For developers/contributors
Community
DataArray.dt.weekday
The day of the week with Monday=0, Sunday=6