troubleshooting Question

International Date ToolTip

Avatar of dtrick
dtrick asked on
.NET ProgrammingC#ASP.NET
4 Comments1 Solution439 ViewsLast Modified:
I have a page that accepts a date in a TextBox. I have a CompareValidator pointed to this TextBox that ensures the value inside the TextBox is a date.

So now I would like to inform the user what format they should enter their date as. So for a site that is operating in the US I should be able to tell them that the format is something like "mm/dd/yyyy". OR if they are in Australia the format should be "dd/mm/yyyy". Or in Germany "" (or something like that).

The key for this is that I don't want to hard-code the value. I also don't want to use a conditional statement like:
IF (US) THEN "mm/dd/yyyy" ELSE "dd/mm/yyyy"

I am wondering if there is some property on the "CurrentCulture" or "CurrentUICulture" objects that would facilitate the automatic generation of a valid short date.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros