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 / How do I get my form t...
Power Apps
Suggested Answer

How do I get my form to save today's date in a date/time column

(0) ShareShare
ReportReport
Posted on by 330
I have a date/time data card that I am using to capture the date and time stamp of when a form is approved/submitted. Right now, when an item in the SharePoint list is approved/submitted, the  field is showing tomorrow's date and a wrong time (instead of today's date and time). Here is how I have the field setup currently...
Default on the date/time datacard
Coalesce(
 varMyDateTime,
 ThisItem.'My Date Time Column"
)
Update on the date/time datacard
If(
 MyForm.Mode = FormMode.New,
 Now(),
ThisItem.'My Date Time Column'
)
I then have a dropdown that users use to select a decision. Once they pick a decision, the date and time should be set.
OnSelect of my dropdown

myColumn_dateValue.SelectedDate = Now();
myColumn_HourValue.Selected.Value = Text(Hour(Now()));
myColumn_MinuteValue.Selected.Value = Text(Minute(Now()));


UpdateContext({varMyDateTime: Now()});
Then in my Patch statement, I am doing this...
Patch(
 'My SharePoint List',
 Lookup(
  'My SharePoint List', ID = ThisItem.ID
 ),
 {
   'My Date Time Column': varMyDateTime
 }

)
 
 
This does displays the correct date and time when the user is first making the decision on the form (when they pick a choice from the dropdown), but when they click the submit button, a date for tomorrow and wrong time is saved in the SharePoint list. So after a user submits an item and goes back to review, they are always seeing the wrong date in the SharePoint list. What am I doing wrong, that is causing it to save tomorrow date?
 
Thanks for your help.
Categories:
I have the same question (0)
  • Suggested answer
    stum Profile Picture
    144 on at
    Hi,
     

    Power Apps stores and evaluates DateTime values in UTC. What the user sees depends on how you convert or format it. You can use TimeZoneOffset(YourTimeField) to convert it to user's timezone.

    Hope it helps.



     
     
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
     
    Clarifying something here - Now() will evaluate initially the date/time in the time zone in the Regional Settings of the user's device (so that is the first thing to check), The value will then be written back to SharePoint, which in the background data storage actually stores it as UTC, however the SharePoint site also has Regional Settings and will display the time stored time according to those settings. Simplifying all of the above from the user's experience, if both the user's device and the SharePoint site have the same time zone settings, then date/time saved will reflect the correct value of when Now() was set.
     
    So in essence, UTC has nothing to do with the viewed data after saving - any time zone difference between the settings of user's device and the SharePoint site will however (it will be added/subtracted when viewed in SharePoint) so you need to also check that. Also when and how are you setting MyDateTime ?
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
     
     
  • Spawn10 Profile Picture
    330 on at
    My local machine is in the central time zone while my SharePoint site is in Eastern time zone. When I check the value in my variable 
    varMyDateTime
    in a label, it shows the correct data/time per my local machine settings. For instance "2/9/2026 4:48 PM" however when I patch it, the data saved into SharePoint shows "2/10/2026 10:36 AM"
     
    I am setting the varMyDateTime variable in the OnChange of my dropdown. 
  • Suggested answer
    Assisted by AI
    Bitcot Automations Profile Picture
    23 on at

    Hi,
    The root cause of the issue is mainly related to how Power Apps and SharePoint handle date and time differently. SharePoint stores all DateTime values in UTC, while the Power Apps Now() function returns the user’s local time (for example, IST). Because of this difference, when you save a value like 10 Feb 10:30 PM IST, SharePoint automatically converts it to UTC, which becomes 11 Feb 04:00 AM, resulting in the next day and an incorrect time being displayed.
    In addition, there is a second issue caused by double saving. Currently, you are using multiple methods at the same time, such as the DataCard Update property, a context variable, Patch(), and manual hour/minute settings. This creates conflicts and overwrites because the Power Apps form already saves the data automatically when you use SubmitForm. Calling Patch again causes the record to be saved twice, which leads to inconsistent or incorrect DateTime values. Simplifying the logic and relying only on the form’s built-in save mechanism will resolve the problem.

     
     

    Main Problems in your code

     

    Problem 1

     
    Patch(...)
     

    Inside a Form → NOT recommended

     

    Problem 2

     
    UpdateContext({varMyDateTime: Now()})
     

    Unnecessary

     

    Problem 3

     
    SelectedDate / Hour / Minute manual set
     

    Not required

     

    Problem 4

     

    No timezone conversion

     
     

    Correct & Clean Fix (Recommended)

     

    Do ONLY this (simple)

     
     

    Step 1 — Remove all these

     

    Delete:

     
    Patch()
    UpdateContext()
    SelectedDate
    = Now()
    Hour/Minute code
     
     

    Step 2 — In DateTime DataCard

     

    Default

    ThisItem.'My Date Time Column'

    Update

    DateAdd(Now(), TimeZoneOffset(), Minutes)

    This converts local → UTC properly

     
     

    Step 3 — Submit button

    SubmitForm(MyForm)

    Nothing else.

     
     

    Final Working Code

     

    DataCard

     
    Default = ThisItem.'My Date Time Column'

    Update = DateAdd(Now(), TimeZoneOffset(), Minutes)
     

    Button

     
    SubmitForm(MyForm)
     
     

    If you ONLY need Date (not time)

     

    Then easiest:

     

    Change SharePoint column → Date Only

     

    and use:

    Update = Today()--------NO timezone problem at all.

     

    Thanks


     
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like â™¥
    Visit my blog
    Practical Power Apps    LinkedIn   

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard