Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Error: Expected a valid date value as the parameter to 'TimezoneOffset' function, received value : null.



We have an application that stores Request objects in SQL. One field in a Request is the Submitted Date (Date Time), and upon opening a request it calculates the Submitted Date by using TimezoneOffset. The current code is:



DateAdd(selectedRequestForApproval.SUBMITTED_DATE, -TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE), Minutes)



When opening the first Request in the users session a TimezoneOffset error appears, however the field always appears correct. Note that it does not appear anytime after the first Request unless the page is refreshed. Error: "Expected a valid date value as the parameter to 'TimezoneOffset' function, received value : null."


I have tried modifying the code slightly for error handling, however nothing has fixed this issue. Here are some examples:



DateAdd(selectedRequestForApproval.SUBMITTED_DATE, (-TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE)), Minutes)

DateAdd(selectedRequestForApproval.SUBMITTED_DATE, If(Isblankorerror(-TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE)),0,-TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE), Minutes))

If(Isblankorerror(-TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE)),"",DateAdd(selectedRequestForApproval.SUBMITTED_DATE, -TimeZoneOffset(selectedRequestForApproval.SUBMITTED_DATE), Minutes)



Any idea on why this error is appearing and how to get it to stop appearing?



Advocate I
Advocate I

This exact issue has been happening recently for me as well when it's never done so before this month. The date still shows as normal too. 

Regular Visitor

I unfortunately have not found a solution yet. It seems that it may be a PowerApps bug versus a code issue.


Let me know if you find anything!

Helpful resources

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,506)