The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events