473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
4 30234
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Assimalyst | last post by:
Hi i have a value entered into an asp text box, procedureDateTxtBx.Text, thet has the format dd/MM/yyyy. I need to convert this into a format recognisable by SQL server in order to properly query...
13
by: Roy | last post by:
Hi all, I'm creating a project that should always use this date format when displays the dates or create dates. The back end database is a SQL Server and I like to know what is the logical way...
10
by: bonnie.tangyn | last post by:
Dear all In my ASP page, user can enter date in dd/mm/yyyy format. How can I use Javascript to convert dd/mm/yyyy to yyyy-mm-dd hh:mm:ss. Please give me some advices. Cheers Bon
1
by: prabhunew2005 | last post by:
I am using postgres,php in web designing. I have to convert date entered in MM-DD-YYYY format to YYYY-MM-DD format. I have to use resulting date format in my search sql. I used todate method. But i...
12
by: Vincent Delporte | last post by:
Hello My site is hosted on a server in the US, hence set up to use the mm/dd/yyyy date format instead of the European dd/mm/yyyy. Also, MySQL stores dates as yyyy-mm-dd, so I need to convert...
0
by: Swati Gunda | last post by:
Hello, I am working on C#. I want to convert system date which is by default in mm/dd/yyyy format into dd/mm/yyyy format. If you know the solution then plz reply me immediately. Thanks Swati
1
by: Swati Gunda | last post by:
Hi, I am working on visual studio.net (1.1). I want to convert the date from mm/dd/yyyy format into dd/mm/yyyy. I have writtern the following code in c# DateTime dt; string...
4
by: thomasc1020 | last post by:
This is regarding VB.NET 2003. Variable 'Date' is a string and it contains date information in this format: "DEC/05/2007". Now I am trying to convert the format as "2007-12-05". Is it...
3
by: neoupadhyay | last post by:
Hi Friends, I am Using ASP.NET1.1 and i want to convert the system date, in dd/MMM/yyyy format. Earlier i use lblDate.Text = System.DateTime.Now.AddMinutes(30).ToString(); But i want to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.