Reports in Excel are off by 1 hour

Version 1

    Details

    Not all of the reports return the times in the local timezone, this covers one method of enabling that ability.


    Resolution

     

    All timestamps are stored in the databases in UTC.

     

    There are existing reports you can use as a template to see how to automatically adjust the time based on the browser's timezone. AgedIncident_15 days is one example.

     

    ----

     

    Here is the expression to shift the date to local time.

     

    The timezone offset is returned in minutes from the application (-420 for MST (-7 UTC))

     

    LastModeDateTime is replaced with whatever field you want shifted in the report.

     

    =(Code.AdjustBrowserOffsetToDatetime(Fields!LastModDateTime.Value,Parameters!TimeZoneOffset.Value))

    This should shift NOW() to be local to the browser.

    =(Code.AdjustBrowserOffsetToDatetime(NOW(),Parameters!TimeZoneOffset.Value))

    Adding the parameter. The function only takes two values, the datetime field and the offset, so Culture shouldn't be needed.

     

    Parameters should be passed from the application as well