How to Get the our executable Linkedition date and time
Previous topic  First topic  Next topic


In some cases, it is necessary to obtain our executable generation time and date. This should be done through a function that obtain such information generated by the linkeditor.
En algunos casos, es necesario obtener la Fecha y Hora de generación de nuestro ejecutable. Esto debería poder hacerse por medio de alguna función que consulte dicha informacion generada por el linkeditor.

In the absence of such a function, here a small idea is developed using the date and time of compilation of a source, which is provided by the compiler Harbour.
Ante la ausencia de dicha funcion, aqui se desarrolla una pequeña idea utilizando la fecha y hora de compilacion de un fuente (source) que es provista por el compilador Harbour.

The date and time are provided by __DATE__ and __TIME__ constants that spread to our sources at compile time. Keep in mind that in incremental compilation processes (ie only compile sources that have been modified), each of the sources has a different date and time.
La fecha y hora estan provistas por sendas constantes __DATE__ y __TIME__ que se propagan a nuestros fuentes en tiempo de compilación. Hay que tener en cuenta que en procesos de compilacón incremental (es decir que solo se compilan los sources que han sido modificados), cada uno de los fuentes tiene una fecha y hora diferentes.

A good idea to unify these data would be to create an user function that reside in a module with FORCERECOMP (see: How to force the recompilation of the modules automatically? for more information), so that from anywhere in our program these functions are invoked returns the current date and time that was used to compile the last time.
Una buena idea para unificar estos datos sería crear funciones de usuario que residan en un módulo con FORCERECOMP (ver: ¿Como forzar automaticamente la recompilacion de modulos? para mas informacion), de modo que desde cualquier lugar de nuestro programa se invoquen dichas funciones que retornaran la fecha y hora que se utilizó para compilar por ultima vez.

For example: Define the following functions in a source with FORCERECOMP and only has these functions to speed up compilation
Por ejemplo: Definir las siguientes funciones en un source con FORCERECOMP y que solo tenga dichas funciones para acelerar su compilacion

Function GetExeDate()
Return __DATE__

Function GetExeTime()
Return __TIME__


Aince that time we may use the following syntax from anywhere in our application and will always return the date and time of the module inwhich the function is defined, and because of having forced the recompilation, corresponds to the last date of executable generation:
A partir de ese momento podriamos usar la siguiente sintaxis desde cualquier lugar de nuestra aplicación y siempre devolverá la fecha y hora del modulo en que esta definida dicha función, y que por tener forzada la recompilación, se corresponde con fecha de generacion del ultimo ejecutable:

mg_msgInfo( "Executable Generation Date: " + GetExeDate() )
mg_msgInfo( "Aproximated Executable Generation Time: " + GetExeTime() )




Marinas-GUI Version 03.06 and
Marinas-IDE Version 05.06 and
LEX Files Version 02.06


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
last update: April 27
2017
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




A Harbour/QT framework to make multiplatform programs

(©) Copyright 2009-2017 by Fernando Santolin (aka CarozoDeQuilmes)
CarozoDeQuilmes@gmail.com

2009-2017 Beta tester and full English translator: Bruno Luciani
Bruno.Luciani@gmail.com

2014-2015 Final English corrector: David Worboys
DavidWorboys@hotmail.com

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

www.marinas-gui.org


www.marinas-gui.org  

Previous topic  First topic  Next topic