DateTime function

  • Thread starter Thread starter TaeHo Yoo
  • Start date Start date
T

TaeHo Yoo

First of all thanks all guys for your time to look at my problem.

The problem I am having is datetime function.
Basically, I would like to have a datetime function that works machine
independently.
So regardless of the format of datetime string(ie,
d/MM/yyyy,dd/MM/yyyy,yyyy/MM/dd), this function takes this string and
convert it to the correct datetime that my server could recognise as
datetime(which is d/MM/yyyy).

Thanks again,
 
TaeHo Yoo said:
The problem I am having is datetime function.
Basically, I would like to have a datetime function that works machine independently.
So regardless of the format of datetime string(ie,
d/MM/yyyy,dd/MM/yyyy,yyyy/MM/dd), this function takes this string and
convert it to the correct datetime that my server could recognise as
datetime(which is d/MM/yyyy).

TaeHo,
Use the DateTime.Parse method. It contains several overload methods which allow you
to specify the CultureInfo, so it knows how to parse different culture formats.

For more information, see the sample code VB.NET code at the bottom of the following page
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatetimeclassparsetopic.asp

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com
 
Back
Top