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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Date Format

Status
Not open for further replies.

eulogy6

Programmer
Apr 30, 2004
26
There is any way to change the system date format,
using VB6?

It's very important to have the yyyy/MM/dd format
when the application starts.

Thanks
 
The user sets the display format of dates via their control panel. Your application needs to have the ability to translate what they enter into a standard date-time variable. If I were a user of your app, and you were to change my date format without my permission, I would regard your application as being defective.

In order to get the user to enter dates in a way that can more easily be stored in a date-time variable, there are three main techniques:

1) Use a date-time specific control (the best way). Microsoft's DateTimePicker falls into this category. Only drawback to this is you don't have the ability to *not* enter a date (you can't leave it blank to skip it).

2) Use a masked-edit control. This restricts the user to only entering numeric values, and can prompt them to enter dates in the correct format, but can't enforce it. You would have to write additional code to validate what they typed in. You still would have the problem of telling Jan 2nd from Feb 1st. Using ordinary textboxes fall into this category too.

3) Use separate controls for day, month & year. Most awkward to use, but is unambiguous so far as telling your months from your days.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
If it is a data bound control that you are concerned with just use the DataFormat property to set format as "yyyy/MM/dd" - if this is not in the list of possible "Date" formats choose "Custom" and type that in

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top