cupboy;10989612 wrote:The manual is incorrect. Copying and pasting their example results in some sort of timezone error.
Not for me; I copied your code and it ran without errors, producing "2000-01-01." Thus, the manual is correct; what is likely incorrect, however, is your PHP configuration. Did you actually read the error message? If so, can you paste it here for us to see?
cupboy;10989612 wrote:I am in the Mountain Time Zone. Maybe I could put it in if I knew what to put there,
Did you try reading the [man]timezones[/man] section in the PHP manual?
cupboy;10989612 wrote:but really I just want the computer time. I don't care about the zone at all.
Okay, well since the other millions of users of PHP do often care about the time zone, so does PHP. Thus the numerous warnings all over the manual, example code, error messages, etc. warning you that you must correctly configure PHP to define the default timezone.
cupboy;10989612 wrote:The purpose of the code is to obtain yesterday's date.
Then why not just do:
echo date('Y-m-d', strtotime('yesterday'));
?