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

Change the date format to dd/mm/yyy if the regional setting of computer is at another format

Status
Not open for further replies.

powerbuilde

Programmer
Oct 2, 2010
29
0
0
EG
i had editmask field of type datetime in formatt dd/mm/yyyy
when my app is running in a machine has date format "yyyy/mm/dd" when the user tries to write 31/12/2012 or any similar date -an error message appears -as it must write 2012/12/31
how can i change the format from my app -as did from regoinal setting
I tried to use Registryset("HKEY_CURRENT_USER\Control Panel\International", "sShortDate", RegString!,'dd/MM/yy'
but no chnage occurs thanks
 
Hi pb,

I tried to reproduce your case but .....

To me it works fine:
Having specified 'aaaa-MM-dd' in windows control panel, windows 7, latest patches/EBF's installed, PB 11.5, I can't get any error at all. It works fine for me, having a dw with a column of type DATE with EditMask 'dd/mm/yyyy'.

Anyway, first of all, what you might not want to hear:
----------------------------------------------------
I think your application should respect the user specified settings of date in his windows, rather than forcing him to use a format he doesn't seem to want, regarding his windows settings for date formats.

To do so, your application should read the date format from windows and apply it dynamically to your date-masks.

regards,
Miguel L.
 
forgot to say, running Spanish windows 7 (that's why 'aaaa' instead of 'yyyy' in windows control panel)

regards,
Miguel L.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top