Skip to main content

Notifications

Power Apps - Building 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. 
  • WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Date to Single Line of Text Error
    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    Buy me a coffee
  • Suggested answer
    WarrenBelz Profile Picture
    WarrenBelz 145,445 on at
    Date to Single Line of Text Error
    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard