Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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?