VB.NET Date conversion

How to convert mm/dd/yyyy to dd/mm/yyyy.

Questions by vineeladudhekula

Showing Answers 1 - 22 of 22 Answers

DateTimePicker1.Format = DateTimePickerFormat.Custom
 DateTimePicker1.CustomFormat = "MM-dd-yyyy"
 DateTimePicker1.Text = Now
MsgBox(DateTimePicker1.Text)
 DateTimePicker1.CustomFormat = "dd-MM-yyyy"
 'DateTimePicker1.Text = Now
 MsgBox(DateTimePicker1.Text)


Try this

  Was this answer useful?  Yes

pradhib.l

  • Aug 21st, 2008
 

By using format function, suppose your regional settings is (system date is the format of mm/dd/yyy)  
       Dim s1 As String
        s1 = System.DateTime.Today.Date ''//format of sys date mm/dd/yyyy
       s1 = Format(CDate(s1), "dd /MM/ yyyy")
        MsgBox(s1)
 i think  it  is useful.

  Was this answer useful?  Yes

ItsSanju

  • Sep 26th, 2008
 

Its better to retrieve the System date format first and system date seperator.

On the basis of that retrieve the vales of Day, Month and year.

Now you are having everything related to date.

You can generte any type of formated date.

I am using this and satisfied.

Regards,
Sanjay

smother

  • Aug 30th, 2011
 

Go to Control panel >> Regional and Language settings >Customized>Change Time Format(hh/mm/ss/tt) and Short Data Format (dd/MM/yyyy)..if your using Windows 7..just try to do as the same.

  Was this answer useful?  Yes

nickycym

  • Sep 14th, 2011
 

Once the data is converted into Date type, then you can work out any format of information from the variable

Code
  1. dim strDate() as string = "MM/dd/yyyy".split("/")

  2. dim myDate as new Date (strDate(2), strDate(0), strDate(1))

  3.  

  4. msgbox(format (myDate, "dd/MM/yyyy"))

  5.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions