Skip to main content
Participant
June 28, 2019
Question

Multiple format time entry

  • June 28, 2019
  • 1 reply
  • 408 views

I want to allow users to enter the time in whatever form they want (as long as it's at least 3 digits {e.g. 0800, 800, 8:00, 0925}) and have the time displayed using the h:MM format when they finish.  I've not been able to find an example of an OR statement that will allow something like this.  Any help is appreciated.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
June 28, 2019

You will need to write a script that looks at the length of the input string. If it's 3 characters, add a colon after the first one. If it's 4, add it after the second.

HavdaddyAuthor
Participant
June 28, 2019

Thank you for your reply.  However, that doesn't answer the conversion of 24 hour to 12 hour.  Do you happen to have a sample script or something to work with?

try67
Community Expert
Community Expert
June 28, 2019

I don't understand what you mean by that... Do you mean that if someone enters "2000" it should change it to "08:00"? How would you know if it's 8 AM or PM?