web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / The value ' : ' cannot...
Power Apps
Answered

The value ' : ' cannot be converted to a date or time value.

(0) ShareShare
ReportReport
Posted on by 78

Dears !

 Please, need help with this error... when open App; show it:

Breitner_Hdez_0-1689017854471.png

 

(DateDiff(
 DateTimeValue(DateValue1.SelectedDate & " " & HourValue1.Selected.Value & ":" & MinuteValue1.Selected.Value),
 (DateValue2.SelectedDate & " " & HourValue2.Selected.Value & ":" & MinuteValue2.Selected.Value),
 TimeUnit.Minutes
)

 

Any idea for fix the error? please!

Categories:
I have the same question (0)
  • madlad Profile Picture
    2,637 Moderator on at

    I could only get this error when the selectable fields are blank.

    This error should resolve when your controls have selected values.

    To avoid having it display this error on launch, the first solution in my mind would be to make this a variable, and only create it when all of these controls have values. Not certain that's the most efficient way to do this however.

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Breitner_Hdez,

    Have you solved your peoblem?

     

    The way you format the date time is not ideal, generally we format a date time using the following formula:

    DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)

     

    So, I suggest you modify your formula as below: 

    DateDiff(
     DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0),
     DateValue2.SelectedDate + Time(Value(HourValue2.Selected.Value), Value(MinuteValue2.Selected.Value), 0),
     TimeUnit.Minutes
    )
  • Breitner_Hdez Profile Picture
    78 on at

    Dear Qi.

     

    U code work perfectly. Thx u Crack!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard