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?

7 REPLIES 7
Pstork1
Dual Super User
Dual Super User

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Lars4
Helper II
Helper II

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. 

 

 

Pstork1
Dual Super User
Dual Super User

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

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. 

Pstork1
Dual Super User
Dual Super User

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

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. 

 

 

CarlosGPG
Frequent Visitor

Hi Lars, i'm trying  this  because the data  keeps saving as date-time but I only want time.  but i cannot change data type to only date, can you guide me please?

 

when i imported the fields they originally came as date time but i havent been able to change it.

thansk in advance

 

thanksCapture.PNG

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,260)