Use the php `date()` function. Your server time should be UTC, your app time should be UTC
I think that this is advice that should never be given; it's too easy for someone else to change the timezone PHP uses somewhere else in the code. I agree that the servers should all be on UTC - and sync'd at that! - but it's unrealistic to hope that this will be the case in all instances; I've seen all kinds of weirdness from clients' codebases after taking their first steps off shared hosting / "my first VPS."
Use "DboSource::expression('NOW()');"
Basically, the only realistic option - and last time I searched (I admit, a while ago) really buried away ;)
I think the biggest problem with PHP is developers not truly understanding the API they are using, and then writing spaghetti code that happens to work.
Agree 100% with you. From some of the client code I've repaired, I've also stumbled over PHP developers apparently not understanding the very basics of programming, and crossing their fingers when it comes to running it ;)
I think that this is advice that should never be given; it's too easy for someone else to change the timezone PHP uses somewhere else in the code. I agree that the servers should all be on UTC - and sync'd at that! - but it's unrealistic to hope that this will be the case in all instances; I've seen all kinds of weirdness from clients' codebases after taking their first steps off shared hosting / "my first VPS."
Use "DboSource::expression('NOW()');"
Basically, the only realistic option - and last time I searched (I admit, a while ago) really buried away ;)
I think the biggest problem with PHP is developers not truly understanding the API they are using, and then writing spaghetti code that happens to work.
Agree 100% with you. From some of the client code I've repaired, I've also stumbled over PHP developers apparently not understanding the very basics of programming, and crossing their fingers when it comes to running it ;)