Skip to content

Time Zone History

The service stores the records creating a history of it and can be registered manually or with the help of the time zones agent.

When manually registering a time zone, there is the option to set the Start value and therefore the possibility to change the history. If the value if lesser that the current one, it will alter the history injecting a new time zone record.

Is it important to notify the client using the service that a history change occurs since it can impact on several levels in their ecosystem. For that purpose an TimeZoneHistoryChanged event is dispatched with the time zone information required to apply any changes required by the client.

The TimeZoneHistoryChanged event consist on:

  • Start: The date where the record occurs.
  • Offset: The time zone offset of the record.
  • Id: The time zone id related to the offset.

To get access to the event it necessary to reference the Contracts:

XML
<ProjectReference Include="$(ServicesPath)TimeZone\ITsynch.Suite.TimeZone.Contracts\ITsynch.Suite.TimeZone.Contracts.csproj" />

And create a consumer for the TimeZoneHistoryChanged event:

C#
1
2
3
4
5
6
7
class TimeZoneHistoryChangedConsumer : IConsumer<TimeZoneHistoryChanged> 
{
        public async Task Consume(ConsumeContext<TimeZoneHistoryChanged> context)
        {
            // Your logic goes here.
        }
}

In there the event can be consumed and proceed to apply any required changes.