MCPcopy Create free account
hub / github.com/github/gh-aw / normalizeTimezoneAbbreviation

Function normalizeTimezoneAbbreviation

pkg/parser/schedule_time_utils.go:16–30  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

14
15// normalizeTimezoneAbbreviation converts common timezone abbreviations to UTC offsets
16func 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
33func isAMPMToken(token string) bool {

Callers 5

normalizeTimeTokensFunction · 0.85
extractTimeMethod · 0.85
extractTimeAfterMethod · 0.85

Calls 2

ToLowerMethod · 0.80
PrintfMethod · 0.45

Tested by 1