Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Regex pattern date and time

Jakub Szymański January 15, 2024

Hello community.

Can I ask for help? 

I try to made Regex pattern validation i short text field on my form.
I am trying to get the following format:

16/01/2024 07:57

DD/MM/YYYY HH:MM (with space between)
So date and time

I have that for date:
^(0?[1-9]|1[0-2])[\/](0?[1-9]|[12]\d|3[01])[\/](19|20)\d{2}$

But not sure how to put time here.

Best regards

1 answer

1 accepted

1 vote
Answer accepted
Jakub Szymański January 17, 2024

Hello Community :)

I hope that will help someone in future. 

That is correct answer. 

^([0]?[1-9]|[1|2][0-9]|[3][0|1])[\/]([0]?[1-9]|[1][0-2])[\/]([0-9]{4})\s([0]?[0-9]|[1][0-9]|[2][0-3])[:]([0][0-9]|[1|2|3|4|5][0-9])$

 

Best regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events