0

In one of my applications, I am running a scheduled import process on Sitecore CM. Scheduled job is set to run every 30 minutes. Whenever the sync runs, I update a root item's field with the sync start timestamp and read it in next schedule to use it as a reference for obtaining the records modified in external datasource post that sync timestamp

Below are some logs

1 ManagedPoolThread #16 07:18:57 INFO Products last sync date (UTC) on /sitecore/Products Repo is : 3/21/2019 1:48:03 AM 2 ManagedPoolThread #16 07:18:57 INFO Retrieving product import process jobs after 3/21/2019 1:48:03 AM 3 ManagedPoolThread #16 07:18:57 INFO No product import process job ran after 3/21/2019 1:48:03 AM 4 ManagedPoolThread #16 07:18:57 INFO ProductSync not required as there are no XML imports ran after last sync date (UTC): 3/21/2019 1:48:03 AM 5 ManagedPoolThread #16 07:18:57 INFO Product Repo Last Sync Date time updated to 20190321T071857Z 6 ManagedPoolThread #2 07:48:59 INFO Products last sync date (UTC) on /sitecore/Products Repo is : 3/21/2019 4:48:26 AM 7 ManagedPoolThread #2 07:48:59 INFO Retrieving product import process jobs after 3/21/2019 4:48:26 AM 8 ManagedPoolThread #2 07:48:59 INFO No product import process job ran after 3/21/2019 4:48:26 AM 9 ManagedPoolThread #2 07:48:59 INFO ProductSync not required as there are no XML imports ran after last sync date (UTC): 3/21/2019 4:48:26 AM 10 ManagedPoolThread #2 07:48:59 INFO Product Repo Last Sync Date time updated to 20190321T074859Z 11 ManagedPoolThread #19 08:19:04 INFO Products last sync date (UTC) on /sitecore/Products Repo is : 3/21/2019 12:17:52 AM

As shown in logs above, at the end of schedule, I update a field in /sitecore/products repo with UTC datetime generated from DateUtil.IsoNowthat internally uses DateTime.UtcNow

e.g. ManagedPoolThread #16 07:18:57 INFO Product Repo Last Sync Date time updated to 20190321T071857Zafter line 5. Notice how the system timestamp and DateUtil.IsoNow are close. This code is running in Azure which is by default set to use UTC server time.

But when the scheduled job ran next time, I expected the date retrieved should be 3/21/2019 07:18:57 AM UTC. But the actual date retrieved by Sitecore is 3/21/2019 4:48:26 AM.

I have only 1 CM and before I read the item, I am wrapping the call in Database cache disabler. I couldn't neither understand this odd behavior nor could find a pattern that can explain this nature.

Looking for some ideas and direction on how this can be corrected.

2
  • In Sitecore Settings, is the ServerTimeZone property set, this would override the timezone set in Azure, which according to you should be set to UTC. 07:18:57 AM / 4:48:26 AM - 30 minutes for scheduling time means there somewhere is a timezone of -3 used, you'll need to find out when this timezone is applied. Is the external datasource using UTC times? Mar 22 '19 at 10:31
  • Thanks for the comment @JevgeniGeurtsen. External database uses UTC completely and is also on Azure SQL Database
    – phani
    Mar 22 '19 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.