cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Dual Super User II
Dual Super User II

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.
Highlighted
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. 

 

 

Highlighted
Dual Super User II
Dual Super User II

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
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. 

Highlighted
Dual Super User II
Dual Super User II

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.
Highlighted
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

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,879)