cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
credence
Level: Power Up

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
Level: Powered On

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.
Lars4
Level: Powered On

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
Level: Powered On

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,508)