DateTime function

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,
 
C

Carl Prothman [MVP]

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,178
Latest member
Crypto Tax Software
Top