{"id":"e453561620142fce","repo":"jackc/pgx","slug":"cannot-decode-v-into-time","errorCode":null,"errorMessage":"cannot decode %v into Time","messagePattern":"cannot decode (.+?) into Time","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/time.go","lineNumber":217,"sourceCode":"\t\treturn err\n\t}\n\n\treturn ts.ScanText(Text{String: string(buf), Valid: true})\n}\n\ntype scanPlanTextAnyToTimeScanner struct{}\n\nfunc (scanPlanTextAnyToTimeScanner) Scan(src []byte, dst any) error {\n\tscanner := (dst).(TimeScanner)\n\n\tif src == nil {\n\t\treturn scanner.ScanTime(Time{})\n\t}\n\n\ts := string(src)\n\n\tif len(s) < 8 || s[2] != ':' || s[5] != ':' {\n\t\treturn fmt.Errorf(\"cannot decode %v into Time\", s)\n\t}\n\n\thours, err := strconv.ParseInt(s[0:2], 10, 64)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot decode %v into Time\", s)\n\t}\n\tusec := hours * microsecondsPerHour\n\n\tminutes, err := strconv.ParseInt(s[3:5], 10, 64)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot decode %v into Time\", s)\n\t}\n\tusec += minutes * microsecondsPerMinute\n\n\tseconds, err := strconv.ParseInt(s[6:8], 10, 64)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot decode %v into Time\", s)\n\t}","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/time.go#L199-L235","documentation":"Error \"cannot decode %v into Time\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/time.go:217 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}