467,076 Members | 910 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,076 developers. It's quick & easy.

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

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 Developersdex http://www.developersdex.com ***
Aug 30 '07 #1
  • viewed: 29839
Share:
4 Replies
On 30 Ago, 11:27, Ashraf Ansari <get_ans...@rediffmail.comwrote:
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

Aug 30 '07 #2
On 30 Ago, 11:39, ciccone1...@gmail.com wrote:
On 30 Ago, 11:27, Ashraf Ansari <get_ans...@rediffmail.comwrote:
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
^_^ 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.

Aug 30 '07 #3
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...

---
Patrice

"Ashraf Ansari" <ge********@rediffmail.coma écrit dans le message de news:
%2****************@TK2MSFTNGP05.phx.gbl...
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 Developersdex http://www.developersdex.com ***

Aug 30 '07 #4
On Aug 30, 11:27 am, Ashraf Ansari <get_ans...@rediffmail.comwrote:
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...

Aug 30 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Assimalyst | last post: by
13 posts views Thread by Roy | last post: by
10 posts views Thread by bonnie.tangyn@gmail.com | last post: by
12 posts views Thread by Vincent Delporte | last post: by
reply views Thread by Swati Gunda | last post: by
1 post views Thread by Swati Gunda | last post: by
4 posts views Thread by thomasc1020@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.