How To Convert dd/mm/yyyy date into mm/dd/yyyy format

Hi My Application recieves date in dd/mm/yyyy format.But I want to convert into dd/mm/yyyy format.If is there any format for that please help me.

Debabrata Pattanaik
4/25/2008 9:19:28 AM 91979 articles. 4 followers. Follow

8 Replies

Similar Articles

[PageSpeed] 35
Get it on Google Play
Get it on Apple App Store

DateTime datenow = DateTime.Now;
DateTime convertdate = Convert.ToDateTime(datenow.ToString("mm/dd/yyyy"));


"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
4/25/2008 9:39:59 AM


4/25/2008 10:14:15 AM

 Hi ,

Another way is :-   now.tostring("d");

Go to page and change culture property of the page to en-us.

Not best way to do it, but is a way to do it.

Hope this helps. 


4/25/2008 10:32:06 AM

Try this if you have your date in string variable.

Dim YourVariable As String


Dim tmpDate As New DateTime

will give you date in mm/dd/yyyy format.

Maulik Patel
MCTS, Software Engineer

Don't forget to click "Mark as Answer" on the post that helped you. This will give you point and help readers to know which post solved your issue and make their search easy.
4/25/2008 10:43:44 AM


I think "mm" should be capital "MM". "mm" means minute.

DateTime dtime=DateTime.Now;


Vince Xu
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
4/29/2008 3:13:12 AM

Vince Xu - MSFT :

I think "mm" should be capital "MM". "mm" means minute.

DateTime dtime=DateTime.Now;


Yah you are correct, my bad.. it should be MM.. so it something like 

DateTime datenow = DateTime.Now;
DateTime convertdate = Convert.ToDateTime(datenow.ToString("MM/dd/yyyy"));


"Code, Beer and Music" that's my way of being a programmer!

How to get your Forum Question Answered | Blog | CodeASP.NET
4/29/2008 3:23:28 AM
Use date1.ToString("MM/dd/yyyy")
4/29/2008 4:13:21 AM


4/29/2008 4:20:19 AM

Similar Artilces:

US date format dd/mm/yyyy gets converted to mm/dd/yyyy
Dear All,I got an sql query that I pass to sql server as a string. I pass a date as a string in the query and compare it to a date in a table.The trouble is somewhere in the process I get ‘01/04/2006’ turned into ‘04/01/2006’ I do understand mm/dd/yyyy is the US date format. The problem is I pass in dd/mm/yyyy and I compare it to dd/mm/yyyy, however it is dd/mm/yyyy gets compared to mm/dd/yyyy for some reason.I tried the 3 variations below, but none works ok, suggesting that the conversion takes place somewhere #in between’. Can someone tell me how to solve this?<code>Dim myDat...

Convert Date Format from mm/dd/yyyy to dd/mm/yyyy
Hi,In my Web application I need to show the date in dd/mm/yyyy format to the user. In my application i am showing the date in various forms e.g. In GridView, In dataGrid, In combo, In textBox will it be possible? ThanksPriyank Kansal  dear,try this, String.Format("{0:yyyy-MM-dd HH:mm:ss}", Now)it will return string like "2007-05-01 12:30:01" set format as per your need.  regards,Niraj sikotara.<!-- Search before you scramble. --!> actually pretty, I am using hundreds of pages in my web application. Now it is very difficult to change the format of ea...

Daterange Picker Calendar control Without clicking Start Date and End Date Separately ( dd/mm/yyyy-dd/mm/yyyy format
Hello all,  Plz Suggest me the Daterange Picker Calendar control . so that i can select a range of date (after clicking on button javascipt calendar will be executed) and date will appear in the format dd/mm/yyyy-dd/mm/yyyy in listbox (like without cliking for Start Date and End Date Separately)  Swati Jain   Check this: NC... Some of the third party Calendar controls allow multiple selections. If they support the ability to just click on the start and then end dates to form a range, or can limit the u...

How to convert the date from UK format dd/mm/yyyy to mm/dd/yyyy before sending it to database
I am having a problem with the dates. my application will be used in USA and also in UK. if the date format is like mm/dd/yyyy then i don't have no problem passing it to stored proc to update or insert, but if i pass the date in UK format dd/mm/yyyy i am getting the following error: (String not recognized as date and time) I am getting the following:  txtNeedDate.PostedDate = "31/01/2007"  i want to use a condition, if the date format is in UK then change it to "01/31/2007" before i pass it to database via storted proc. Please does any one know how i can convert the above dat...

date format being changed from mm/dd/yyyy to mm/dd/yyyy hr:mm am
Hello All,i am importing a excel sheet into a sql database. in the excel sheet i have column whose date format is mm/dd/yyyy (07/16/2008). but when ever i import the sheet into the database, its automatically getting changed to 07/16/2008 12:00 am. any idea how i can retain the excel format. any help would be highly appreciated.Thanks  That is the way in SQL Server's datetime data type before we have SQL Server 2008 available. You can format the datetime to remove the time part in your query or format it from client side. Let us know if you need more help.Limno Hello Sir,can you...

Formatting the Date from dd/mm/yyyy to mm/dd/yyyy
Hi,  I have a textbox in which the date is coming from a javascript calendar in dd/m/yyyy format but i want to change that into mm/dd/yyyy. I am trying to do like this DateTime dtProjectStartDate=Convert.ToDateTime(uxdate.Text);Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); dtProjectStartDate = Convert.ToDateTime(dtProjectStartDate); but it is giving me the error "string was not recognised as a valid datetime. " and i have tried this also but getting the same error. Please help me.DateTime.ParseExact(uxdate.Text...

Date Format (YYYY/MM/DD) From (MM/DD/YYYY)
I am very new to (started this week)  I have the following line FormatDateTime(dsEdit.FieldValue("BDateStart", Container),2) which is currently displaying the date as MM/DD/YYYY when I need YYYY/MM/DD to suit my database (MySQL)  How can I go about formatting the date to suit my needs?  Thankyou With FormatDateTimeyou have a limited range of formatting options see FormatDateTime(dsEdit.FieldValue("BDateStart", Container),2)to dsEdit.FieldValue("BDateStart", Container).ToString("yyyy/MM/dd") &...

How to change the format of Date from dd/MM/yyyy -> yyyy/MM/dd
The Code is-protected void btnSave_Click(object sender, EventArgs e) {DataSet ds = new DataSet();SqlDataAdapter adp = new SqlDataAdapter("select max(Int_MemberShipNo) as mem_no from M_CA", con); adp.Fill(ds);if (ds.Tables[0].Rows[0][0].ToString() == "") { mem_no = 1; } else {mem_no = Convert.ToInt16(ds.Tables[0].Rows[0][0]) + 1;Session["mem_no"]=mem_no.ToString(); } DateTime dt_dob = Convert.ToDateTime(txtDOB.Text); DateTime dt_dom = Convert.ToDateTime(txtDOM.Text);if (RadioButtonList1.SelectedItem.Text == "Home") {i = "H"; ...

How to convert textbox value date from dd/MM/yyyy to MM/dd/yyyy
I have the date in textbox in this format(dd/MM/yyyy), how can i convert textbox1.text date to MM/dd/yyyy. Thank you very much for the information.    TextBox1.Text.ToString( "MM/dd/yyyy" ); Hi, you need to set specific cultrue to parse string to dateTime, and then output desired time format. However I have one simple way to swith day and month.    TextBox1.Text = "08/30/1999";   DateTime temp;    temp = Convert.ToDateTime(TextBox1.Text);   TextBox1.Text = temp.ToString("dd/MM/yyyy"); // or "MM/dd/yyyy" &n...

date format dd/mm/yyyy in aspx pages but mm/dd/yyyy in access db
I'm working with 2.0 and having the problem that my date/time objects are stored in american format (mm/dd/yyyy) in my access database, but on my page they are in european format (dd/mm/yyyy).How do i get the dates in my database to be in european format.The code follows, the problem is that when i select a date in my calender obj and press the button1, the date is forwarded to the SqlDataSource InsertCommand. (in debug mode i can see that the date that is passed to the SqlDataSource is still in the correct format).In my database i can see that the date has gone from 01/10/2005 to 10...

How to change date format from mm/dd/yyyy to dd/mm/yyyy in sql server 2005 express edition
I have a page where i m showing some data and date which is in mm/dd/yy format in detail view,but i want to show date in dd/mm/yy format. I tried but it didn't work.What should i do. Please help me out. ThanksWeb DeveloperPune,India Hi here is the sample query. SELECT CONVERT(VARCHAR(20), GETDATE(), 103)Hope this will work.  Valentine Day Special SongASP.NET ListView Control  I don't think you need to change the representation of dates in Sql Server, but only how they are presented in the DetailsView.  For that you can use a dataformatstring of "{0:...

How do i format dd/MM/yyyy back to MM/dd/yyyy?
i've a webform that allow people to enter a date in the format of "dd/MM/yyyy" and i've a regular expression to validate it. But problem is now i have to insert this date into the db. And when i do so, it keep saying "Cast from string "30/01/2001" to type 'Date' is not valid." when i try to insert it using a function like: Line 488: If buttonSaveItem.CommandArgument = "Add" Then Line 489: InvoiceStruct.AddInvoice( _ Line 490: CType(textboxInvoiceDate.Text, Date), _ Line 491: textboxInvoiceCustomer...

save date in database n retrieve with format dd\mm\yyyy not mm\dd\yyyy display to main.aspx
I need input from user using text box which is like this dd mm yyyy and how can i manipulate so that i can save in db with default format mm dd yyyy? HI, you can use the format method of the textbox and specify the date format in that. I havent tried but it should work. Have a Great DayRegardsRamu can u provide me with example so that i can see clearly what ur point...tq Hi, If possible ask the user to enter the date in dd-mmm-yyyy fromat so that, there won't be any confusion between month and date when you save your record in db. otherwise, you can use format functi...

how can i convert the string from "21/12/2005" which is in dd/MM/yyyy format to MM/dd/yyyy
hi all i would like to convert a string that is when user type in the textbox let say "21/12/2005" in dd/MM/yyy and convert to MM/dd/yyyy . how do it do that ?Karen Dim dt As DateTime = txtInput.Text txtOutput.Text = dt.ToString("MM/dd/yyyy")think this should do it Dim strDate(3) as String Dim strDateNewFormat as String strDate = txtDate.text.split("/"c) strDateNewFormat = strDate(1) & "/" & strDate(0) & "/" & strDate(2) ThanksDinuj Nath Try this link for sample code.  Hope this helps.

Web resources about - How To Convert dd/mm/yyyy date into mm/dd/yyyy format -

File:Convert to SVG and move to Commons.svg - Wikipedia, the free encyclopedia
As a courtesy (but not a requirement), please e-mail me or leave a note on my talk page if you use this image outside of Wikipedia. Thanks! As ...

Facebook Co-Founder Dustin Moskovitz Sells 450K Shares, Converts 7M More
The great Facebook stock sale frenzy continues on with a report that Co-Founder Dustin Moskovitz unloaded 450,000 shares in the social network ...

Facebook Announces “App2User” Liquidity Program for Merchants to Convert Rewards Points into Credits
... for Credits, just announced a new Credits program called “App2User,” designed to enable merchants and loyalty program operators to convert their ...

How to Convert Leads Into Buying Customers - The 9 Step Sales Process EVERYONE Should Use
... School of Business in Toronto on the topics of Sales and Entrepreneurship. I shared with them the sales process that I find How to Convert Leads ...

Bitcoin : Should I convert my savings to Bitcoin?
Answer (1 of 7): You should think of this question as "Should I invest all my savings in Bitcoin?", and not "Should I have my savings denominated ...

Convertizo 2 - Convert Units and Currency in Style on the App Store on iTunes
Get Convertizo 2 - Convert Units and Currency in Style on the App Store. See screenshots and ratings, and read customer reviews.

Catholics should not convert Jews, says Vatican, in push against anti-Semitism
... 50 years since the Vatican's repudiation of the concept of Jewish guilt for Jesus' death.  Vatican City: Catholics should not try to convert ...

Opinion: These 5 things made me a happy iPad Pro convert
... like I needed a bigger device. But after three weeks with my iPad Pro, several things have changed my mind, and I’m officially a happy convert ...

Today’s apps gone free: BlockBear, Stock Grader, PDF Smart Convert and more
Block ads and other annoying content, take the emotion out of investing, and convert almost anything into a PDF with todays collection of apps ...

Ford patents rear wheel that converts into a unicycle
Filed under: Government/Legal , Green , Ford , Green Driving , Motorcycle , Electric Ford is thinking about allowing drivers to remove a rear ...

Resources last updated: 1/4/2016 6:04:44 AM