How to display the date as MM-DD-YYYY in TDateEdit ? lazarus / 7-LCL ---------------------------------------------------------------------- Anonymous · 2005-09-24 03:24 TDateEdit control. How to make the control to display the date as  MM- DD-YYYY the default is DD-MM-YYYY not all countries are using this format. TIA ---------------------------------------------------------------------- matthijs · 2005-09-26 06:39 You don't set the display format on a control basis. Display formats for dates should be set application wide, although this is very bad practice. You could change the display format for a date by: Code: [Select]   ShortDateFormat := 'mm-dd-yyyy'; And personally I think the American date notation is the most illogical way to do it. ---------------------------------------------------------------------- Anonymous · 2005-09-26 15:08 Quote from: "matthijs"You don't set the display format on a control basis. Display formats for dates should be set application wide, although this is very bad practice. You could change the display format for a date by: Code: [Select]   ShortDateFormat := 'mm-dd-yyyy'; Thanks Matthijas, it works!  I put in  FormCreate Code: [Select]   if  libc.getenv('LC_TIME') = 'en_US'  then       ShortDateFormat := 'mm-dd-yyyy';           Why setting the format  application wide is bad practice?  Are there any other code depend on specific date format internally? How about the numeric display of  monetary values. Is there any global setting for $ 123,123.12  like in US  and other countries have  123.123,12  ? LC_MONETARY=en_US QuoteAnd personally I think the American date notation is the most illogical way to do it. :D I absolutely agree, the date notation as well as many other things are wacko . ---------------------------------------------------------------------- matthijs · 2005-09-26 20:19 Quote from: "Anonymous" Why setting the format  application wide is bad practice?  Are there any other code depend on specific date format internally? Because you might confuse your user. Suppose he is used to the dateformat dd-mm-yyyy and you change it in your app to mm-dd-yyyy, then when he sees a date like 12-05-2005 he might expect it to be the 12th of may, but it is the 5th of december! So I think it is bad practice to change these settings in the GUI. What you do internally is completely up to you of course. ---------------------------------------------------------------------- Marc · 2005-09-27 09:43 BTW, in stead of using libc.getenv, it is more portable (and less libc dependent) to use GetEnvironmentVariable declared in SysUtils