Skip to content
Advertisement

Get week range with timezone

I’m trying to get week range for a given date. I use the below code to do so.

JavaScript

How can I make it work so it take timezone into account? My timezone is GMT+1 but the returned date has – 1 hour difference

Advertisement

Answer

You can use date_default_timezone_set() for that.

https://www.php.net/manual/en/function.date-default-timezone-set.php

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement