Working out the format string of a date/time

M

matturbanowski

I am wondering, does anyone know if there is an easy way in VB
(ASP.NET) to calculate what format a date time has been written in?
Supposing you entered a value into a text box, it is easy enough to get
it to convert that value to a datetime, but is there a way to work out
what format was originally entered?
For example:
Entering "09:00" returns "hh:mm"
Entering "1-Jan-2000 10:00:00" returns "dd-MMM-yyyy hh:mm:ss"

Thanks in advance,
Matt
 
C

Cor Ligthert [MVP]

Matt,

I wish there was, you need an extra column to tell what culture is used or
you have to tell on the page in what format it should be.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top