cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
credence
New Member

Datacard Update with Date

I have been trying to set a Datacard update value to the current day by using the Today() or Date() functions in conjunction with Now() function where necessary. The problem I have been having is the date is always showing the previous day with a time of 23:00. Is there something default that can cause date values to write the previous date and not the current date?

6 REPLIES 6
Dual Super User
Dual Super User

Re: Datacard Update with Date

What time zone are you in?  I suspect the problem is that dates are always stored in UTC but displayed in the user's local time zone. So I assume you are in a Timezone that is one hour off UTC and that is the problem.  Because if you input just a date you will normally store that as that date at midnight. If you then display it in the local timezone it shows up as yesterday at 11:00PM



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Lars4 Helper II
Helper II

Re: Datacard Update with Date

I had no time to look deeply into it yet, but I also saw today that the records I create via NewForm with date datacard have the date of yesterday. 

I store date without time. So I cannot see how many hours the records are away from the actual date. I have to play a bit for more information. 

 

Sitting in Germany. We are two hours ahead of UTC at the moment. 

 

 

Dual Super User
Dual Super User

Re: Datacard Update with Date

The problem is you can't store the date without a time component.  Even if you save a DateOnly field it actually gets saved in the database behind SharePoint as a Date/Time value.  As I said if you store just the date then it will default to taht date at midnight. I can't explain the 2 hours ahead versus 1 hour difference, but I can guarantee that the issue revolves around not adjusting for timezone and saving dateOnly dates.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Lars4 Helper II
Helper II

Re: Datacard Update with Date

I did not want to disagree with you. I am sure it is about the saving in different time zones. I just wanted to mention my experience, because it might be not as easy to explain as it sounds in your first reply. 

By the way, I am using CDS. 

 

Anyways, I will go into the details with my app and share the results here. 

Dual Super User
Dual Super User

Re: Datacard Update with Date

I totally agree that its not easy to wrap your head around this issue.  I still struggle with getting it to work right all the time.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Lars4 Helper II
Helper II

Re: Datacard Update with Date

Just wanted to come to this topic for telling you, what fixed the issue for me. 

It might not be helpful for you, because you want to store time as well. 

 

However, in the advanced options of my field with data type "date only" I changed the Behavior to "date only". Afterwards, the right date gets stored without any time. 

 

 

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,189)