diff --git a/core/dbio/iop/csv.go b/core/dbio/iop/csv.go index 10e3d8db..2729e1ec 100755 --- a/core/dbio/iop/csv.go +++ b/core/dbio/iop/csv.go @@ -596,7 +596,7 @@ func detectDelimiter(delimiter string, testBytes []byte) (bestDeli rune, numCols // GetISO8601DateMap return a map of date parts for string formatting func GetISO8601DateMap(t time.Time) map[string]interface{} { m := map[string]interface{}{} - for _, v := range []string{"YYYY", "YY", "MMM", "MM", "DD", "HH", "hh", "mm", "ss"} { + for _, v := range []string{"YYYY", "YY", "MMM", "MM", "DD", "DDD", "HH", "hh", "mm", "ss"} { m[v] = t.Format(Iso8601ToGoLayout(v)) } return m @@ -607,11 +607,13 @@ func GetISO8601DateMap(t time.Time) map[string]interface{} { // https://www.iso.org/iso-8601-date-and-time-format.html func Iso8601ToGoLayout(dateFormat string) (goDateFormat string) { goDateFormat = strings.TrimSpace(dateFormat) + goDateFormat = strings.ReplaceAll(goDateFormat, "TZD", "-07:00") goDateFormat = strings.ReplaceAll(goDateFormat, "YYYY", "2006") goDateFormat = strings.ReplaceAll(goDateFormat, "YY", "06") goDateFormat = strings.ReplaceAll(goDateFormat, "MMM", "Jan") goDateFormat = strings.ReplaceAll(goDateFormat, "MM", "01") goDateFormat = strings.ReplaceAll(goDateFormat, "DD", "02") + goDateFormat = strings.ReplaceAll(goDateFormat, "DDD", "Mon") goDateFormat = strings.ReplaceAll(goDateFormat, "HH", "15") goDateFormat = strings.ReplaceAll(goDateFormat, "hh", "03") goDateFormat = strings.ReplaceAll(goDateFormat, "mm", "04") diff --git a/core/dbio/iop/stream_processor.go b/core/dbio/iop/stream_processor.go index d0a7ee87..4e6da44f 100644 --- a/core/dbio/iop/stream_processor.go +++ b/core/dbio/iop/stream_processor.go @@ -225,6 +225,7 @@ func NewStreamProcessor() *StreamProcessor { "2006/01/02 15:04:05", "02-01-2006", "02-01-2006 15:04:05", + "Mon, 02 Jan 2006 15:04:05 -0700", } // up to 90 digits. This is done for CastToStringSafeMask diff --git a/core/sling/task_state.go b/core/sling/task_state.go index d7acb81b..f1836b73 100644 --- a/core/sling/task_state.go +++ b/core/sling/task_state.go @@ -33,6 +33,7 @@ type DateTimeState struct { MMM string `json:"MMM,omitempty"` MM string `json:"MM,omitempty"` DD string `json:"DD,omitempty"` + DDD string `json:"DDD,omitempty"` HH string `json:"HH,omitempty"` } @@ -50,6 +51,7 @@ func (dts *DateTimeState) Update() { dts.MM = now.Format("01") dts.DD = now.Format("02") dts.HH = now.Format("15") + dts.DDD = now.Format("Mon") } type RunState struct {