[SOLVED] TCalendar Change? lazarus / 31-LCL ---------------------------------------------------------------------- Pascaluvr · 2012-02-29 12:50 I have just got another PC - previously I had Windows XP, but on my new PC I have Win7. My application uses TCalender to select a date of records to examine.  On XP CalDayChanged returns dd/mm/yyyy in Cal.date but after recompiling under Win7, Cal.Date returns dd-Mmm-yyyy (as in 29-Feb-2012).   Am I missing something here or is this a compatibility issue with 'write once - compile anywhere'? ---------------------------------------------------------------------- zeljko · 2012-02-29 13:23 afair, there's bug in fpc which does not read properly locales on win7, so it assumes defaults OR check your locale settings for dates in cpl. ---------------------------------------------------------------------- Pascaluvr · 2012-02-29 13:38 Thank you for your prompt reply... and while I thought I was reasonably computer savy...   I have no idea what this means: "OR check your locale settings for dates in cpl." cpl????? Thanks again ---------------------------------------------------------------------- Avishai · 2012-02-29 13:43 cpl = Control Panel/Regional Settings ---------------------------------------------------------------------- Pascaluvr · 2012-02-29 13:58 Thanks for that.  Strangely, there is no setting for the XP response.  What is worse, is that if I give my program to someone else, they have to change the settings on their computer to suit my needs,,, and possibly screw up other programs! Surely 'Write once  - compile anywhere' doesn't come with fine print for common functions. Don't get me wrong... Laz/FPC are great products and I'm not criticizing... but for compatibility surely the Lazarus function should return the same, regardless of cpl settings? ---------------------------------------------------------------------- Avishai · 2012-02-29 14:30 You can try this: procedure TForm1.CalChange(Sender: TObject); begin   Edit1.Text:= FormatDateTime('dd/mm/yyyy',Cal.DateTime); end; ---------------------------------------------------------------------- paweld · 2012-02-29 18:11 or in FormCreate set: Code: [Select]ShortDateFormat:='dd-mm-yyyy'; ---------------------------------------------------------------------- Pascaluvr · 2012-02-29 20:50 Quote from: paweld on February 29, 2012, 07:11:19 pmor in FormCreate set: Code: [Select]ShortDateFormat:='dd-mm-yyyy'; Thank you = that was the problem.  I hadn't set the date format in Control Panel.  I will also add this code so that my program will run on someone else's computer.