[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

inputquery for time value

Hi,

I need a simple inputquery that allows to enter a time value in the following format:
hh:nn:ss:mm
01:15:23:87

Is there an easy way how this can be accomplished?
0
Stef Merlijn
Asked:
Stef Merlijn
  • 3
  • 2
1 Solution
 
Randy PooleCommented:
The simplest way would be to create a custom form and handle the input accordingly using a maskedit control as the input field.
0
 
Stef MerlijnDeveloperAuthor Commented:
@Randy Poole: A custom form would be an option.
How needs the mask to be setup if I want to force a time in the requested format?
hh:nn:ss:mm
01:15:23:87

I've already tried some masks, but I don't get the correct result.
Like: (0?\d | 1\d | 2[0-3]) : [0-5]\d : [0-5]\d : \d\d
0
 
Randy PooleCommented:
You can try this regex:
([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9]):([0-9][0-9])
this assumes 0 based prefix required
0
 
Stef MerlijnDeveloperAuthor Commented:
Perfect. This works fine for me.

By the way:
MaskKind must be set to emkRegExprEx otherwise the ":" won't show automatically.
0
 
Randy PooleCommented:
cool to know :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now