I have an odd error. If I call:
date("js M")
it shows tomorrow's date, I don't know what changed because yesterday that function was working just fine. I haven't tested anything in production, as far as I can see, it only happens in localhost.
I already checked my clock and it is right, is there any other place where PHP fetches the date? What could have changed? Thank you!
By Default the date()
function uses a unix timestamp, which is always set to +0:00.
date_default_timezone_set('America/New_York');
If you set the default timezone, the unix timestamp used will apply the correct offset to your location and you should be getting the correct day for you no matter where you are.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With