Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Why, when I don't enter a date, does it get recorded as 12/31/1969?

(1) ShareShare
ReportReport
Posted on by 825 Super User 2025 Season 1
I have a form where the end date field is optional. However, if nothing is entered, it gets recorded as 12/31/1969. How do I avoid that?
 
  • Verified answer
    futr_vision Profile Picture
    825 Super User 2025 Season 1 on at
    Why, when I don't enter a date, does it get recorded as 12/31/1969?
    Lots of trial and error but I found the offending code. Here it is. 

    Update property for the datacard
    If(!IsBlank(DP_EndDate.SelectedDate), DP_EndDate.SelectedDate,0)
     
    The correct code is
     
    If(!IsBlank(DP_EndDate.SelectedDate), DP_EndDate.SelectedDate)
     
    When the if statement is false it appears the "0" gets translated as day 0 which I believe is explained by this statement
     

    The default date of 12/31/1969 in PowerApps is a common issue related to the way dates are handled in computing. This date is often associated with the Unix epoch time, which starts at 00:00:00 UTC on January 1, 1970. When a date value is not properly initialized or is set to zero, it can default to this epoch time, which in some time zones appears as 12/31/196912.

     
  • ronaldwalcott Profile Picture
    3,512 on at
    Why, when I don't enter a date, does it get recorded as 12/31/1969?
    Did you check that Dataverse isn't adding the value?
  • futr_vision Profile Picture
    825 Super User 2025 Season 1 on at
    Why, when I don't enter a date, does it get recorded as 12/31/1969?
    Understood. I removed everything that was asked and still get the default date being added. 
  • ronaldwalcott Profile Picture
    3,512 on at
    Why, when I don't enter a date, does it get recorded as 12/31/1969?
    @futr_vision I understand that, but you are trying to debug the problem. Unless you are monitoring the variables removing the If is your second best option to start determining the nature of the problem. Your first option should be using Monitor to ensure that the application is flowing as expected. 
  • futr_vision Profile Picture
    825 Super User 2025 Season 1 on at
    Why, when I don't enter a date, does it get recorded as 12/31/1969?
    @ronaldwalcott
     
    This if statement is there when the user decided to copy an existing record. The end data is pulled from a global variable that holds the copied record.
  • ronaldwalcott Profile Picture
    3,512 on at
    Why, when I don't enter a date, does it get recorded as 12/31/1969?
    Remove the If and set the default to 
    ThisItem.'End Date'
     
    If the date remains blank then you are updating those variables somewhere that you are unaware.
  • futr_vision Profile Picture
    825 Super User 2025 Season 1 on at
    Why, when I don't enter a date, does it get recorded as 12/31/1969?
    Thanks. Changed up the code but it still writes 12/31/1969 if no date is selected.
  • Suggested answer
    Nandit Profile Picture
    1,563 Super User 2025 Season 1 on at
    Why, when I don't enter a date, does it get recorded as 12/31/1969?
     
    I agree with ronaldwalcott, your variable could be the reason why you are facing this issue. Can you try replacing your DataCard Default with the following:
    If (
        varCopy && !IsBlank(glbFormData.dk_enddate),
        glbFormData.dk_enddate,
        ThisItem.'End Date'
    )
     
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     
  • ronaldwalcott Profile Picture
    3,512 on at
    Why, when I don't enter a date, does it get recorded as 12/31/1969?
    It wouldn't but are you tracking the state when you are testing? If not, removing it would immediately indicate if it were the cause. 
  • futr_vision Profile Picture
    825 Super User 2025 Season 1 on at
    Why, when I don't enter a date, does it get recorded as 12/31/1969?
    Hmm. Just the presence of a global variable, even if it is empty, would cause this issue?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard