web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Now() Bug in Online De...
Power Apps
Answered

Now() Bug in Online Developer

(0) ShareShare
ReportReport
Posted on by 46

Recently, Now() has been generating and storing inconsistent DateTime values in my SQL Databse when "previewing" apps in the online web developer.

 

I've been running into this issue when testing an app in the online web developer. What happens is that after editing an app for a while (about 30-60 min), I enter "Preview the App" and create / send a new record to my SQL database using the Now() function to capture the current date and time. What has been happening is that the first record I create generates a seemingly-random DateTIme value (sometimes off by a day, sometimes a couple of hours, sometimes more than a day, etc...). If I then create a second record in the App Preview, however, it generates and stores the correct date and time that it should (the time that the Now() function was orginally called ... when I loaded the web developer about 30-60 minutes prior.)

 

A few notes :

- I am in PTC timezone ( -8 ) and I know that PowerApps uses UTC, thus I adjust for this when viewing the dates sent from PowerApps into SQL. This is not a timezone issue, given I notice these random DateTime values when I view the dates directly in the SQL database.

- When Now() is behaving properly, it sends the correct time (in my PTC timezone) into the SQL database and I view these as correct.

 

Given these Now() values are random and "correct" themselves after creating a second record, I am to believe that this is a bug in the "Preview App" mode of the online developer tool.

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @James_Hellfeier,

    How do you save data into your SQL table within your app? Using SubmitForm function or Patch function?

    I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:14.JPG

    Set the OnSelect property of the "Patch" button to following formula:

    Patch(
    '[dbo].[TaskLists1]',
    Defaults('[dbo].[TaskLists1]'),
    {
    Creator:"PowerApps Test",
    Task_current_state:"Build",
    Task_due_date: Now() /* <-- Task_due_date is a DateTime type column in my SQL table */
    }
    )

    Please take a try with above solution, then check if the issue is solved.

    In addition, please also make sure that the Time Zone of your SQL Server is same with your local time zone.

    If the issue still exists, please take a try to re-create your app, then save data into your SQL table using Patch function, then check if the issue is solved.

    More details about Patch function, please check the following article:

    Patch function

     

    Best regards,

    Kris

  • James_Hellfeier Profile Picture
    46 on at

    I've been submitting forms with SubmitForm() instead of Patch(), however I updated my app to submit with : 

    Patch( 'dbo' , Defaults( 'dbo' ) , NewForm.Updates )

     

    where the DATETIME field being sent to my SQL server is populated by a calendar card in the NewForm with default set to Now() and its timezone set to the same timezone as my SQL server. Note : this is not a custom card and was linked to my SQL server by choosing it as a datafield when making a Form set to New().

     

    Since updating using Patch(), my issue has gotten worse. Now it sends a consistent time to the SQL server, however this time is off a wacky amount. I reloaded my app (to reset Now() to the current time) and it is currently 5:30 AM, which my date datacard shows in my app by the way, however my SQL server is receiving a time of 10:54 AM ... again my timezone is PTC, which is 8 hours off of UTC, so this shouldn't be a timezone issue. Also note that it's off not on a perfect hour, also suggesting that this may not be a timezone issue.

     

    Reloaded my app once again and my datacard is showing 5:34 AM

     

    powerapps1.PNG

     

    while my server is receiving 11:08 AM when I Patch() ..... (7th column in the below picture)

     

    powerapps3.PNG

    .... you can see here that the timezone on my DataCard is set to "local", which matches my SQL server.

     

    powrapps2.PNG

     

    As a matter of fact, when I load up the entry in PowerApps, I'm shown this 11:08 AM value in the data field of the record, meaning PowerApps is correctly adjusting for the timezones.

     

    This leads me to believe that PowerApps is sending DateTime values into my SQL server, not offset by a timezone amount and inconsistent with the updates of the Datacard that it's pushing.

     

  • James_Hellfeier Profile Picture
    46 on at

    Note : Tried running this in the WebPlayer as well ... running into the same issues. This time, however, my times are 10 hours apart instead of 6.change.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @James_Hellfeier,

    Which time zone does your SQL Server belongs to? Have you customized the time zone for your browser?

    Further, is the SQL Server existed in same computer device where you run your app?

    Currently, I could not reproduce your issue on my side. Based on the screenshot that you provided, it may be a time zone issue.

    In addition, please also check if you have customized the time zone for your browser. Please make sure the time zone your browser belongs to is same with your local time zone.

    Please also make sure the time zone your SQL Server belongs to is same with your local time zone.

    If the issue still exists, please consider re-create your app, check if the issue is solved.

     

    Best regards,

    Kris

  • James_Hellfeier Profile Picture
    46 on at

    Timezone in my browser is set to the standard Local Timezone.

     

    Timezone for my SQL server (located on the same premise as me) is also set to Local.

     

    Thinking the app may just have something wrong with it. I've been creating another app that uses Now() to grab times and then Patch() those into a different table in the same server and haven't been having any issues with wonky times.

  • Verified answer
    TimW Profile Picture
    82 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard