[Lazarus] Retrieve VersionInfo at runtime

Luiz Americo Pereira Camara luizmed at oi.com.br
Fri Jan 22 11:30:00 CET 2010

Luiz Americo Pereira Camara escreveu:
> Graeme Geldenhuys escreveu:
>> 2010/1/22 Luiz Americo Pereira Camara <luizmed at oi.com.br>:
>>>> const
>>>>  cCompileDate = {$I %date%};
>>>>  cCompileTime = {$I %time%};
>>>> I couldn't find a way of formatting the date and time to my locale 
>>>> (under
>>>> Linux, not sure for other platforms). It seems to be hard-coded, so 
>>>> you
>>>> will have to parse and format it manually.
>> ...
>>> The returned value is also hardcoded under windows. I  need to parse 
>>> using
>>> ScanDateTime from DateUtils
>> I wonder if we should file that as a bug for FPC
> I think of that (in fact i started writing the bug report) but since 
> is defined at compiler time it will not be possible AFAIK to use the 
> ShortDateFormat at runtime (say you compile in a yyyy/mm/dd system and 
> run in a dd/mm/yyyy you will still get yyyy/mm/dd)

A better solution would be to implement a macro that returns a TDateTime 
value instead of a string


More information about the Lazarus mailing list