diff --git a/config/configuration.go b/config/configuration.go index c2c89b931..1425cde7b 100644 --- a/config/configuration.go +++ b/config/configuration.go @@ -246,7 +246,7 @@ const ( // - Comma delimited list of days of the week in English, or 3 letter abbreviation (e.g. "Monday,Tuesday,Wednesday" or "Mon,Tue,Wed" would both be valid values). Weekdays string = "Weekdays" - // TimeZone sets the time zone for this session; if specified, StartTime and EndTime will be converted from this zone to UTC. + // TimeZone sets the time zone for this session; if specified, StartTime, EndTime, and ResetSeqTime will be converted from this zone to UTC. // Times in messages will still be set to UTC as this is required by FIX specifications. // // Required: No diff --git a/session_factory.go b/session_factory.go index f530ddf14..a2291cad7 100644 --- a/session_factory.go +++ b/session_factory.go @@ -352,6 +352,27 @@ func (f sessionFactory) newSession( } if settings.HasSetting(config.ResetSeqTime) { + + if s.TimeZone == nil { + loc := time.UTC + if settings.HasSetting(config.TimeZone) { + var locStr string + if locStr, err = settings.Setting(config.TimeZone); err != nil { + return + } + + loc, err = time.LoadLocation(locStr) + if err != nil { + err = errors.Wrapf( + err, "problem parsing time zone '%v' for setting '%v", + settings.settings[config.TimeZone], config.TimeZone, + ) + return + } + } + s.TimeZone = loc + } + var seqTimeStr string if seqTimeStr, err = settings.Setting(config.ResetSeqTime); err != nil { return