# ShiftDateTime function in Crystal Reports formulas

There are few documents, help files, SAP Notes and forum posts availble on the subject. But still to clear some confusions about the way the function works and to prevent some reports failures during shift time, I decided to show how it works in a different way.

“Picture tells more than a thousand words” and I decided to start with a word time zones picture and tried to match time intervals colors with sections of the function:

Note: Only numbers do matter in the formula, text like: “PST”, “PDT”,  “WEuropeDT” for description only

Here are few examples how the formula above will calculate the time difference in 2012:

PST,480, PDT,-60                WEurope ST,-60, WEuropeDT,-60

9 hours shift for January 1                 ((     480              )      –      (                   – 60                              )) / 60 = 9 hours

8 hours shift for March 15                  ((     480        –60)      –      (                   – 60                               )) / 60 = 8 hours

9 hours shift for July 1                       ((     480       – 60)      –      (                   – 60                    – 60     )) / 60 = 9 hours

8 hours shift for November 1             ((     480       – 60)      –      (                   – 60                               )) / 60 = 8 hours

Once again there is nothing new in this article. It is just a different way to show it and I hope in a right time.