Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date format in VB application independent of the regional settings

Status
Not open for further replies.

mohaimen

Programmer
Joined
Dec 24, 2001
Messages
25
Location
BD
Hi,

I want to set the date format (dd/mm/yyyy) in my VB application indepdent of the regional setting of the computer so that the user enters and retrieves the date in (dd/mm/yyyy) format even if the regional settings of the computer is different.

Regards.

Mohaimen
 
Hi Mohaimen,

I would suggest looking into the FormatDateTime function. I think you are wanting to something similiar to:

text1.text = FormatDateTime(Date, vbShortDate)
 
Enter the date any way you want. Just get it into a Date variable, which is format neutral, using CDate then format it anyway you want e.g.
Format(myDate,"dd/mm/yyyy") Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top