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 / 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)
  • Suggested answer
    WarrenBelz Profile Picture
    154,447 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
  • WarrenBelz Profile Picture
    154,447 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   

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard