I’m using date('j') function in calendar. The problem is that it returns not correct day. For example in my country today is day 17 and this function return day 16. How to fix this?
I’m using date(‘j’) function in calendar. The problem is that it returns not correct
Share
By default
datereturns the date and time based on the server’s time. Check out the output to the following:This will tell you the current exact time and date that the sever is set to.
Remember, the server is a computer just like your own – only it is probably located somewhere half-way around the world. Just as your computer’s clock is set to the local time where your are located, the server’s clock is probably set to the local time where it is located.
However, you can use date_default_timezone_set in PHP to set the time and date you want to use in a script. This will change the default timezone used in that script.