{"record":{"id":"c31cc8e7bf834b65","repo":"argoproj/argo-workflows","slug":"scheduled-time-contains-invalid-time-rfc3339-forma","errorCode":null,"errorMessage":"scheduled-time contains invalid time.RFC3339 format. (e.g.: `2006-01-02T15:04:05-07:00`)","messagePattern":"scheduled-time contains invalid time\\.RFC3339 format\\. \\(e\\.g\\.: `2006-01-02T15:04:05-07:00`\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/submit.go","lineNumber":194,"sourceCode":"}\n\nfunc submitWorkflowFromResource(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, resourceIdentifier string, submitOpts *wfv1.SubmitOpts, cliOpts *common.CliSubmitOpts) error {\n\tparts := strings.SplitN(resourceIdentifier, \"/\", 2)\n\tif len(parts) != 2 {\n\t\treturn fmt.Errorf(\"resource identifier '%s' is malformed. Should be `kind/name`, e.g. cronwf/hello-world-cwf\", resourceIdentifier)\n\t}\n\tkind := parts[0]\n\tname := parts[1]\n\n\ttempwf := wfv1.Workflow{}\n\n\tif err := validateOptions([]wfv1.Workflow{tempwf}, submitOpts, cliOpts); err != nil {\n\t\treturn err\n\t}\n\tif cliOpts.ScheduledTime != \"\" {\n\t\t_, err := time.Parse(time.RFC3339, cliOpts.ScheduledTime)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"scheduled-time contains invalid time.RFC3339 format. (e.g.: `2006-01-02T15:04:05-07:00`)\")\n\t\t}\n\t\tsubmitOpts.Annotations = fmt.Sprintf(\"%s=%s\", wfcommon.AnnotationKeyCronWfScheduledTime, cliOpts.ScheduledTime)\n\t}\n\n\tcreated, err := serviceClient.SubmitWorkflow(ctx, &workflowpkg.WorkflowSubmitRequest{\n\t\tNamespace:     namespace,\n\t\tResourceKind:  kind,\n\t\tResourceName:  name,\n\t\tSubmitOptions: submitOpts,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to submit workflow: %w\", err)\n\t}\n\n\tif err = printWorkflow(created, common.GetFlags{Output: cliOpts.Output}); err != nil {\n\t\treturn err\n\t}\n","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/submit.go#L176-L212","documentation":"`argo submit --from ... --scheduled-time` expects an RFC3339 timestamp (time.RFC3339 layout, e.g. 2006-01-02T15:04:05-07:00) which is validated with time.Parse; on failure the command returns this fixed-message error. The value is later attached as the cronworkflow scheduled-time annotation.","triggerScenarios":"Running `argo submit --from cronwf/x --scheduled-time '2026-09-03 10:00:00'` — space instead of 'T', missing timezone offset, or any string time.Parse(time.RFC3339) rejects.","commonSituations":"Using human-friendly date formats (YYYY-MM-DD HH:MM:SS); omitting the timezone (RFC3339 requires either 'Z' or ±hh:mm offset); locale-formatted dates from scripts.","solutions":["Provide a valid RFC3339 string, e.g. --scheduled-time '2026-09-03T10:00:00Z' or '2026-09-03T10:00:00+02:00'.","Replace the space between date and time with 'T'.","Generate the value with `date -u +%Y-%m-%dT%H:%M:%SZ` to guarantee the format."],"exampleFix":"// before\nargo submit --from cronwf/hello-world-cwf --scheduled-time '2026-09-03 10:00:00'\n// after\nargo submit --from cronwf/hello-world-cwf --scheduled-time '2026-09-03T10:00:00Z'","handlingStrategy":"validation","validationCode":"t := \"2026-09-03T10:00:00Z\"\nif _, err := time.Parse(time.RFC3339, t); err != nil {\n    return fmt.Errorf(\"--scheduled-time must be RFC3339: %w\", err)\n}","typeGuard":"func isRFC3339(s string) bool { _, err := time.Parse(time.RFC3339, s); return err == nil }","tryCatchPattern":"err := cmd.Run()\nif err != nil && strings.Contains(err.Error(), \"scheduled-time contains invalid\") {\n    log.Fatal(\"use RFC3339, e.g. 2026-09-03T10:00:00Z\")\n}","preventionTips":["Generate timestamps with date -u +%Y-%m-%dT%H:%M:%SZ.","Always include a timezone ('Z' or ±hh:mm).","Use 'T' between date and time, not a space."],"tags":["cli","argo-cli","datetime","validation","rfc3339"],"backgroundTag":"invalid-timestamp-format","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}