Add date/time tokens to comiler includes $I and $INCLUDE: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND
Original Reporter info from Mantis: dezlov
-
Reporter name: Denis Kozlov
Original Reporter info from Mantis: dezlov
- Reporter name: Denis Kozlov
Description:
Currently the build date/time can be inserted into code via compiler variables as so: {I %DATE%} and {
I %TIME%} (http://www.freepascal.org/docs-html/prog/progsu41.html).
It would be very useful to also make the individual date/time tokens available too: {I %YEAR%}, {
I %MONTH%}, {I %DAY%}, {
I %HOUR%}, {I %MINUTE%}, {
I %SECOND%}.
Or, alternatively, without polluting the naming space, as:
{I %DATEYEAR%}, {
I %DATEMONTH%}, {I %DATEDAY%}, {
I %TIMEHOUR%}, {I %TIMEMINUTE%}, {
I %TIMESECOND%}.
There are several advantages:
- {
I %DATE%} and {
I %TIME%} are inserted as strings and require parsing if any manipulations or reformatting needs to be done.
- {
I %DATE%} and {
I %TIME%} are inserted as strings and can be easily found and replaced (patched) in the executable, which is a problem when used for some kind of restricted functionality.
Mantis conversion info:
- Mantis ID: 26472
- Version: 2.6.4
- Fixed in version: 3.1.1
- Fixed in revision: 38329 (#c671683e)
- Monitored by: » dezlov (Denis Kozlov)