Changing regional settings!!

P

Patrick

HI!!
I would like to know if its possible to change the date
format in the 'regional settings' of windows to a
different format.

For example,presently my date format is 'Short date' and
my template looks like this: YY-MMM-DD.

On a specific form,in its 'Open Event', could I change the
template to : YYYY-MMM-DD. only while the user is on this
form, after it should return back to: YY-MMM-DD.

Can it be done, if so, those anyone out there now a way to
do this, or something else that might emmulate what I'm
trying to do...HELP!!

thanx in advanced for all you're help,
Patrick

P.S. this will be usefull for viewing and the Input mask.
 
R

Rick Brandt

Patrick said:
HI!!
I would like to know if its possible to change the date
format in the 'regional settings' of windows to a
different format.

For example,presently my date format is 'Short date' and
my template looks like this: YY-MMM-DD.

On a specific form,in its 'Open Event', could I change the
template to : YYYY-MMM-DD. only while the user is on this
form, after it should return back to: YY-MMM-DD.

Can it be done, if so, those anyone out there now a way to
do this, or something else that might emmulate what I'm
trying to do...HELP!!

If you want control of it don't use the named formats like "Short Date".
If you use an explicit format string like "yyyy-mmm-dd" then you get the
format you want regardless of regional settings and you can have as many
different formats in your app as you want.
 
D

Douglas J. Steele

Rick's already told you how to use explicit formats to do this.

I just wanted to point out that it's generally regarded as extremely poor
programming practise to change the user's settings. The user has presumably
chosen the settings for a reason: it's our job to respect their choices.
Remember that yours may not be the only application the user is using at the
time: you would be affecting all other applications.
 
P

Patrick

Thank you both very much for your help and programming
tips. This 'Short date' business of mind was used on a few
forms, but know I can changed them back to the format
string discuss earlier,

thank you!!!

Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top