{"record":{"id":"4ca1440268155674","repo":"benbjohnson/litestream","slug":"invalid-timestamp-must-specify-in-iso-8601-forma","errorCode":null,"errorMessage":"invalid -timestamp, must specify in ISO 8601 format (e.g. 2000-01-01T00:00:00Z)","messagePattern":"invalid -timestamp, must specify in ISO 8601 format \\(e\\.g\\. 2000-01-01T00:00:00Z\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/restore.go","lineNumber":90,"sourceCode":"\t\tctx = cancelCtx\n\t\tdefer cancel()\n\t}\n\n\tswitch *integrityCheck {\n\tcase \"none\":\n\t\topt.IntegrityCheck = litestream.IntegrityCheckNone\n\tcase \"quick\":\n\t\topt.IntegrityCheck = litestream.IntegrityCheckQuick\n\tcase \"full\":\n\t\topt.IntegrityCheck = litestream.IntegrityCheckFull\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid -integrity-check value: %s\", *integrityCheck)\n\t}\n\n\t// Parse timestamp, if specified.\n\tif *timestampStr != \"\" {\n\t\tif opt.Timestamp, err = time.Parse(time.RFC3339, *timestampStr); err != nil {\n\t\t\treturn errors.New(\"invalid -timestamp, must specify in ISO 8601 format (e.g. 2000-01-01T00:00:00Z)\")\n\t\t}\n\t}\n\n\t// Determine replica to restore from.\n\tvar r *litestream.Replica\n\tif litestream.IsURL(fs.Arg(0)) {\n\t\tif *configPath != \"\" {\n\t\t\treturn fmt.Errorf(\"cannot specify a replica URL and the -config flag\")\n\t\t}\n\t\tif r, err = c.loadFromURL(ctx, fs.Arg(0), *ifDBNotExists, &opt); errors.Is(err, errSkipDBExists) {\n\t\t\tslog.Info(\"database already exists, skipping\")\n\t\t\treturn nil\n\t\t} else if err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tif *configPath == \"\" {\n\t\t\t*configPath = DefaultConfigPath()","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/restore.go#L72-L108","documentation":"This error is raised by the restore command's Run when the -timestamp flag cannot be parsed with time.Parse(time.RFC3339, ...). The restore point must be an ISO 8601 / RFC 3339 timestamp so it can be matched against replica positions.","triggerScenarios":"Passing -timestamp with a non-RFC3339 value: \"2024-01-01\" (date only), \"2024-01-01 10:00:00\" (space instead of T), missing timezone, or Unix epoch numbers.","commonSituations":"Users copying timestamps from logs or database dumps in local formats, or passing a relative value like \"1 hour ago\" expecting natural-language parsing.","solutions":["Format the value as RFC3339, e.g. 2024-01-01T10:00:00Z","Include a UTC offset (Z or +02:00) — it is mandatory","Drop the -timestamp flag to restore to the latest available state"],"exampleFix":"// before\nlitestream restore -timestamp 2024-01-01 10:00:00 -o db.sqlite repl\n// after\nlitestream restore -timestamp 2024-01-01T10:00:00Z -o db.sqlite repl","handlingStrategy":"validation","validationCode":"ts, err := time.Parse(time.RFC3339, *timestamp)\nif err != nil {\n    return fmt.Errorf(\"-timestamp must be RFC3339 like 2006-01-02T15:04:05Z\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always emit timestamps with time.Format(time.RFC3339)","Include the timezone suffix (Z or offset) in scripted restores","Omit -timestamp when you want the latest state"],"tags":["cli","timestamp","restore","validation"],"backgroundTag":"invalid-date-format","analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}