How to format time in infopath function in sharepoint

I have sharepoint list and new list form is customized in Infopath. I have a datetime field column where I'm filling date and time. I have another single text column where I want to store time only from the value captured from above datetime column.

I'm using a rule type Action to set the value for my single text column and using substring function but I get weird format of time like T00:00:00. I want to get in the format as 12:00 AM or 11:30 PM etc.

How to format the date time and get time only in the above format
buzzme123Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
Don't use a substring because the original data is an number of seconds past the epoch use a data type of time

https://support.office.com/en-ie/article/Format-a-date-time-or-number-615658fa-d1ec-4b16-907f-7691339397a1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
buzzme123Author Commented:
Can I see an example of this?
buzzme123Author Commented:
No response on this yet. Please show me an example of how to format this?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.