This file contains time parsing and conversion utilities used by the schedule parser. These helper functions transform various time formats into minute/hour values for cron expressions. normalizeTimezoneAbbreviation converts common timezone abbreviations to UTC offsets
(token string)
| 14 | |
| 15 | // normalizeTimezoneAbbreviation converts common timezone abbreviations to UTC offsets |
| 16 | func normalizeTimezoneAbbreviation(token string) (string, bool) { |
| 17 | switch strings.ToLower(token) { |
| 18 | case "pt", "pst": |
| 19 | scheduleTimeUtilsLog.Printf("Warning: PT timezone is ambiguous; treating as UTC-8 (PST)") |
| 20 | return "utc-8", true |
| 21 | case "pdt": |
| 22 | return "utc-7", true |
| 23 | case "est": |
| 24 | return "utc-5", true |
| 25 | case "edt": |
| 26 | return "utc-4", true |
| 27 | default: |
| 28 | return "", false |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | // isAMPMToken checks if a token is an AM/PM indicator |
| 33 | func isAMPMToken(token string) bool { |