By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,070 Members | 1,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,070 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.