Error on Date field "DateDiff function: dates are in different time zones"

Version 1

    Details

    Customer may get the following error when using a date diff function on a validation rule set up to ensure users do not pick future dates.  


    This business object could not be saved. Please contact your administrator to address the issue.
    DateDiff function: dates are in different time zones. 

    CurrentDateStr() is returning a string date only, like "4/20/2015" if in the US English locale and it is April 20.   When converted back to a date/time there is no time zone information and so the date time is marked as "unspecified".   This is not compatible with LogDate, which is returned in UTC.

     


    Resolution

    Changed customer's Validation rule from $(DateDiff("day",  CurrentDateStr(),  DateField) >= 0) to $(DateField<= BeginningOfDay()).  Launch Configure Application Open your Business Object Select the Business Rules tab Scroll down to the Validation rule and edit Replace $(DateDiff("day",  CurrentDateStr(),  DateField) >= 0) with $(DateField<= BeginningOfDay()) Save Refresh Browser