I am facing a problem of validating date & time according to local culture.
This is my RegularExpressionValidator
<asp:RegularExpressionValidator
ID="regTime"
ControlToValidate="txtTime"
Display="Dynamic"
Text="Invalid Time Format"
ValidationExpression="^((1[012])|(0?[1-9])):([0-5][0-9]) ?([aApP][mM])$"
runat="server">
</asp:RegularExpressionValidator>
The above validator validates time of en-en culture.
Now as I am developing an applications which needs to be able to handle date and time format of every culture, I want a concrete solution to how to validate date & time depending on culture using RegularExpression.
For example, American time format is h:mm tt (01:20 PM) & German time format is HH:mm (13:20).
Go to the complete details ...