Issue: Formatted date times are not appearing correctly in emails/notifications according to the time zone.

Version 1

    Details

    When trying to format a date time in an email notification, the date time displayed is different that the same field value unformatted. It seems an issue, but in fact there is a reason for it.   In the AdminUI, in the "Organizational Profile-Account Information-Preferred Time Zone" area, the email notifications are configured in a particular time zone and format. Once a different format is applied, the configured format is no longer applied for that notification, but neither is the time zone, so it uses the original date time.  This article demonstrates how to simulate the prevent this problem and calculate the correct date time to the time zone selected. 


    Resolution

    Create a global value named "Daylight", type Number, where the value will be the actual difference in hours with GMT, taking care about the Daylight savings.



    If the field "CreateDateTime" is used for the notification, and the time zone is "Central America (UTC -6:00)", this way should send it correctly:

    $(FormatDate(DateAdd("hour", DateDiff("hour", CreatedDateTime, ToClientTime(CreatedDateTime)) +GetGlobal('Daylight'), CreatedDateTime), "dd/MM/yyyy hh:mm tt"))

    The date format selected is
    "MM/dd/yyyy hh:mm", but as it is explained in the Admin's Help, Function FormatDate, it could be any fitting of the configuration defined in this page: http://msdn.microsoft.com/en-us/library/8kb3ddd4%28v=vs.110%29.aspx