Searched best I can but cannot find anything on our boards about this.
Is there a way I can get a Variable (long) set in my program that has the Date/Time of when the program was compiled?
eg:
B4X:
Dim CompileTime as Long = #CompilerTime
Is there a compiler directive for this?
BobVal
PS: Came across this can - will any of them work in B4A
B4X:
try{
ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(),0);
ZipFile zf =newZipFile(ai.sourceDir);
ZipEntry ze = zf.getEntry("classes.dex");
long time = ze.getTime();
String s =SimpleDateFormat.getInstance().format(new java.util.Date(time));
zf.close()
;
}
catch(Exception e)
{}
B4X:
android {
defaultConfig {
buildConfigField "long","TIMESTAMP",System.currentTimeMillis()+"L"}}
Then read it at runtime.
Date buildDate =newDate(BuildConfig.TIMESTAMP);