GeekInterview.com
Series: Subject: Topic:
Question: 17 of 73

VB.NET Date conversion

how to convert mm/dd/yyyy to dd/mm/yyyy.
Asked by: vineeladudhekula | Member Since Mar-2008 | Asked on: Apr 18th, 2008

View all questions by vineeladudhekula

Showing Answers 1 - 8 of 8 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

  
Login to rate this answer.
pradhib.l

Answered On : Aug 21st, 2008

View all answers by pradhib.l

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.

  
Login to rate this answer.
ItsSanju

Answered On : Sep 26th, 2008

View all answers by ItsSanju

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

Yes  1 User has rated as useful.
  
Login to rate this answer.

Just write following code
DateTimePicker1.CustomFormat = "dd-MM-yyyy"

  
Login to rate this answer.
SunilDadaDbms

Answered On : Jan 5th, 2011

View all answers by SunilDadaDbms

I think it will work
Date.Today.Tostring("dd/mm/yyyy")

  
Login to rate this answer.

    MsgBox(System.DateTime.Today.Day & "-" & System.DateTime.Today.Month & "-" & System.DateTime.Today.Year)

  
Login to rate this answer.
smother

Answered On : Aug 30th, 2011

View all answers by smother

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.

  
Login to rate this answer.
nickycym

Answered On : Sep 14th, 2011

View all answers by nickycym

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.  

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.