Github Gist to Find WordPress Start of Week Date

I signed up for Github well over a year ago. Yesterday I finally added some code.

For a couple of days I’ve struggled to figure out the best way to get the date for the first day of the current week. Yesterday I finally came up with a solution that seems to work. It uses the WordPress function current_time so it takes into account the timezone setting. It also adjusts based on the start of week setting.

[gist https://gist.github.com/kevmarsden/5385639]

Let me know if you know a better way to do this.

Author: Kevin

WordPress and Laravel developer. Founder of ActiveTrackers.com.

Leave a Reply

Your email address will not be published.