convert MM/dd/yyyy format into dd/MM/yyyy

A

Ashraf Ansari

Hi,

How Can I convert MM/dd/yyyy format into dd/MM/yyyy and the date
which is converted into dd/MM/yyyy should be in DateTime format. I do
not want to store it as a string.


Please help

Thanks in advance
 
C

ciccone1978

Hi,

How Can I convert MM/dd/yyyy format into dd/MM/yyyy and the date
which is converted into dd/MM/yyyy should be in DateTime format. I do
not want to store it as a string.

Please help

Thanks in advance

*** Sent via Developersdexhttp://www.developersdex.com***

Hi,
try something like that:

DateTime oldDate = ...//your datetime in MM/dd/yyyy format
DateTime newDate = DateTime.Parse(oldDate.ToString("dd/MM/yyyy")); //
in the new format

Bye
 
P

Patrice

Unclear. What do you have . A string ?

For now I'm not sure if :
- you want to convert a MM/dd/yyyy string to a date
- or if you already have a date that is displayed as MM/dd/yyyy in which
case you don't have to convert it. You can display the same date in whatever
format you want (ASP.NET uses be default the globalization seetting in the
web.config file to which country convention a Date should be displayed).

A date in DateTime format doesn't have a dd/MM/yyyy format or any other
dispaly format i.e. the internal representation of a date is always the
same. The issue is that when the value of a date is displayed each country
may have its own convention...
 
C

ciccone1978

Hi,
try something like that:

DateTime oldDate = ...//your datetime in MM/dd/yyyy format
DateTime newDate = DateTime.Parse(oldDate.ToString("dd/MM/yyyy")); //
in the new format

Bye

^_^ maybe what I wrote before is unnecessary, the two DateTime are the
same.
The matter concerns only when you print the value with different
formats to the end user.
 
G

Guest

Hi,

How Can I convert MM/dd/yyyy format into dd/MM/yyyy and the date
which is converted into dd/MM/yyyy should be in DateTime format. I do
not want to store it as a string.

Please help

Thanks in advance

*** Sent via Developersdexhttp://www.developersdex.com***

date is always date...
 

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top