{"record":{"id":"9d2089f98169e4a9","repo":"nextcloud/all-in-one","slug":"you-did-not-enter-a-correct-time-one-correct-exam","errorCode":null,"errorMessage":"You did not enter a correct time! One correct example is '04:00'!","messagePattern":"You did not enter a correct time! One correct example is '04:00'!","errorType":"validation","errorClass":"InvalidSettingConfigurationException","httpStatus":422,"severity":"warning","filePath":"php/src/Data/ConfigurationManager.php","lineNumber":908,"sourceCode":"\n    public function getCollaboraSeccompPolicy() : string {\n        $defaultString = '--o:security.seccomp=';\n        if (!$this->collaboraSeccompDisabled) {\n            return $defaultString . 'true';\n        }\n        return $defaultString . 'false';\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     */\n    public function setDailyBackupTime(string $time, bool $enableAutomaticUpdates, bool $successNotification) : void {\n        if ($time === \"\") {\n            throw new InvalidSettingConfigurationException(\"The daily backup time must not be empty!\");\n        }\n\n        if (!preg_match(\"#^[0-1][0-9]:[0-5][0-9]$#\", $time) && !preg_match(\"#^2[0-3]:[0-5][0-9]$#\", $time)) {\n            throw new InvalidSettingConfigurationException(\"You did not enter a correct time! One correct example is '04:00'!\");\n        }\n\n        if ($enableAutomaticUpdates === false) {\n            $time .= PHP_EOL . 'automaticUpdatesAreNotEnabled';\n        } else {\n            $time .= PHP_EOL;\n        }\n        if ($successNotification === false) {\n            $time .= PHP_EOL . 'successNotificationsAreNotEnabled';\n        } else {\n            $time .= PHP_EOL;\n        }\n        file_put_contents(DataConst::GetDailyBackupTimeFile(), $time);\n        $this->dailyBackupFileCache = '';\n        $this->dailyBackupFileMtime = 0;\n    }\n\n    private function getDailyBackupFileContent() : string {","sourceCodeStart":890,"sourceCodeEnd":926,"githubUrl":"https://github.com/nextcloud/all-in-one/blob/6b788eec5e61733cf03ed380a3572e43ae3f11ce/php/src/Data/ConfigurationManager.php#L890-L926","documentation":"Thrown by setDailyBackupTime when the time string matches neither ^[0-1][0-9]:[0-5][0-9]$ nor ^2[0-3]:[0-5][0-9]$, i.e. anything but a valid 24-hour HH:MM between 00:00 and 23:59. Leading zeros and two-digit hours are mandatory.","triggerScenarios":"Submitting '4:00' (missing leading zero), '24:00' (invalid hour), '04:0' or '0400' (format), '04:60' (invalid minute), or a time with seconds like '04:00:00'.","commonSituations":"12-hour clocks with AM/PM ('4:00 AM'); locales that format times differently; scripts generating times without sprintf('%02d:%02d', ...); users entering midnight as '24:00' instead of '00:00'.","solutions":["Use a strict 24-hour HH:MM string with leading zeros, e.g. '04:00'.","In scripts, format with zero-padding before sending.","For midnight use '00:00', never '24:00'."],"exampleFix":"// before\n$time = '4:00';\n\n// after\n$time = sprintf('%02d:%02d', 4, 0); // '04:00'","handlingStrategy":"validation","validationCode":"if (!preg_match('#^([01]\\d|2[0-3]):[0-5]\\d$#', $dailyBackupTime)) {\n    // reject before calling setDailyBackupTime()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use an HTML <input type=\"time\"> or zero-padded 24h formatting on the client.","Generate times with sprintf('%02d:%02d', $h, $m)."],"tags":["php","nextcloud-aio","input-validation","time-format","backup"],"backgroundTag":"invalid-time-format","analyzedSha":"6b788eec5e61733cf03ed380a3572e43ae3f11ce","analyzedAt":"2026-08-21T05:47:24.382Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}