HH:MM:SS format for string field

Roshani
Tera Expert

Hi All,

I have a string field and i want to put validation , so that it takes only format of :  HH:MM:SS , also it includes (24 hr max, 60 min max and 60 sec ) like this. 

 

2 REPLIES 2

Yousaf
Giga Sage

Hi Roshani,

Please try this regex

^([0-1]?\d|2[0-4])(?::([0-6]?\d))?(?::([0-6]?\d))?$

How to use : Field validation: Regular Expressions

Mark Correct and Helpful if it helps.


***Mark Correct or Helpful if it helps.***

Appli
Mega Sage
Mega Sage

Hi, you may use this one:

^([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])$

Hope it helps

Hope it helps