Working out the format string of a date/time

  • Thread starter Thread starter matturbanowski
  • Start date Start date
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
 
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
 
Back
Top