|
Incorrect FormatDateTime parameter
It is a common mistake, when passing the format string to the FormatDateTime function, that ‘mm’ is used for minutes instead of ‘nn’. For example:
lblDate.Caption:=FormatDateTime(’dd/mm/yyyy hh:mm’,Now);
should probably read:
lblDate.Caption:=FormatDateTime(’dd/mm/yyyy hh:nn’,Now);
Whilst it is perfectly valid, it is probably wrong with the intention to display minutes and eyebol will warn that this might be incorrect.
This would be more of an issue but for the fact that the Delphi source code tries to take account of the fact that so many people make this mistake and will interpet mm as months under the context of dates and as minutes under the context of times.
< Back to list of hints and warnings
|