Avatar ·

Fehler "It is not safe to rely on the system's timezone settings" in PHP: Wie beheben?

Hallo zusammen! Ich habe gerade angefangen, PHP zu lernen, und bin auf einen unverständlichen Fehler gestoßen, als ich versucht habe, das aktuelle Datum auszugeben. Ich schreibe ein einfaches Script:\n\n```php\n\n```\n\nAber statt des Datums erhalte ich eine Warning:\n\n```\nWarning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.\n```\n\nIch arbeite auf einem lokalen OpenServer, PHP Version 8.2. Ich habe versucht zu googeln, aber die Ratschläge gehen auseinander: Manche sagen, man soll die php.ini bearbeiten, andere – eine Funktion in den Code einfügen.