{"record":{"id":"3ef2d5a93254ed13","repo":"briannesbitt/Carbon","slug":"timezone-id-is-invalid-it-must-be-one-of-the","errorCode":null,"errorMessage":"Timezone ID '{}' is invalid.\nIt must be one of the IDs from DateTimeZone::listIdentifiers(),\nFor the record, hours/minutes offset are relevant only for a particular moment, but not as a default timezone.","messagePattern":"Timezone ID '(.+?)' is invalid\\.\nIt must be one of the IDs from DateTimeZone::listIdentifiers\\(\\),\nFor the record, hours/minutes offset are relevant only for a particular moment, but not as a default timezone\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Carbon/Factory.php","lineNumber":848,"sourceCode":"\n        return (bool) @preg_match('/^'.$regex.'$/', $date);\n    }\n\n    private function setDefaultTimezone(string $timezone, ?DateTimeInterface $date = null): void\n    {\n        $previous = null;\n        $success = false;\n\n        try {\n            $success = date_default_timezone_set($timezone);\n        } catch (Throwable $exception) {\n            $previous = $exception;\n        }\n\n        if (!$success) {\n            $suggestion = @CarbonTimeZone::create($timezone)->toRegionName($date);\n\n            throw new InvalidArgumentException(\n                \"Timezone ID '$timezone' is invalid\".\n                ($suggestion && $suggestion !== $timezone ? \", did you mean '$suggestion'?\" : '.').\"\\n\".\n                \"It must be one of the IDs from DateTimeZone::listIdentifiers(),\\n\".\n                'For the record, hours/minutes offset are relevant only for a particular moment, '.\n                'but not as a default timezone.',\n                0,\n                $previous\n            );\n        }\n    }\n}\n","sourceCodeStart":830,"sourceCodeEnd":860,"githubUrl":"https://github.com/briannesbitt/Carbon/blob/b13f05955dcfd7da71d60af745fd148cbdb73505/src/Carbon/Factory.php#L830-L860","documentation":"Error \"Timezone ID '{}' is invalid.\nIt must be one of the IDs from DateTimeZone::listIdentifiers(),\nFor the record, hours/minutes offset are relevant only for a particular moment, but not as a default timezone.\" thrown in briannesbitt/Carbon.","triggerScenarios":"Thrown at src/Carbon/Factory.php:848 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b13f05955dcfd7da71d60af745fd148cbdb73505","analyzedAt":"2026-08-17T04:40:56.953Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}