I'm using DateTime to truncate to the start day of the week (and other things) using timezone Europe/Amsterdam.

However, I got the request to use Sunday as the start of week instead of Monday. I can't find anything in the documentation about this other than some printing options which aren't really helping me. Also, local_day_of_week gives 1 on Sunday, but this is still not enough.

The problem is that the week numbers change when the start of the week is changed. E.g. if Monday is the first day in week 10, then the Sunday before would be in week 9. However, if Sunday is the first day of the week, that same Sunday would be in week 10 instead of 9.

So I want to be able to use DateTime to say my date is that Sunday, truncate to week and when I ask the date, get the starting day of week 10 (that Sunday), instead of 9 (Monday week ago).

Hope that makes more sense :) I know there is a way around it, but was wondering if it was possible with a package that deals with dates already.

I can print the week number that starts on Sunday with DateTime as well, but that doesn't solve my problem. I need to be able to truncate it to the start of the week so I can get a timestamp. Printing the current week only gets me so far :)

Sure, I can do it manually, but I wondered if DateTime could do that for me, because I have quite a bit of code to change that uses the truncate function.