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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Date to Single Line of...
Power Apps
Suggested Answer

Date to Single Line of Text Error

(1) ShareShare
ReportReport
Posted on by
I keep getting this error the string was not recognized as a valid datetime. there is a unknown word starting at index 1.
 
I am trying to patch a date input and 3 drop downs for hour, minutes and AM/PM to a single line of text. I created a collection to store the data, but it keeps saying the same error.
 
Any help would be appreciated. 
app.jpg
collection.jpg
code.jpg
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,529 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • Suggested answer
    WarrenBelz Profile Picture
    153,529 Most Valuable Professional on at
    Firstly, can you please remember to post your code in Text - saves re-typing here. The code below is OCR'd so watch spelling.
    If you are using something similar to this blog of mine, and are trying to convert it into a valid date/time to update a field of that type, the first one is
    'Departure Date': 
    dp_Departure.SelectedDate + 
    Time(
       If(
          dd_DeparturePM.Selected.Value = "PM", 
          12, 
          0
       ) + 
       Mod(Value(dd_DepartureHour.Selected.Value), 12), 
       Value(dd_DepartureMin.Selected.Value),
       0
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 421

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard