2021-04-21

AutoHotkey & Java: Calendar will take your given milliseconds as UTC, then offset with your timezone when you do: Calendar.getTime().

 
Senarior:
Come across to integrate AutoHotkey & Java.

getting timestamp in milliseconds from AutoHotkey, then pass into Java process.


Found out:
Calendar will offset your milliseconds(a or b, which is UTC timstamp) with your timezone.


Given as below:

a = Calendar.getTime()

&

b = System.currentTimeMillis()

&

EpochTimestamp_Now_UTC := A_NowUTC
EnvSub, EpochTimestamp_Now_UTC, 19700101000000, Seconds
Milliseconds_Now_UTC := EpochTimestamp_Now_UTC * 1000 + A_MSec
c := Milliseconds_Now_UTC 


Billson@20210415_pm121738 : System.currentTimeMillis(); = Calendar.getInstance().getTimeInMillis(); = A_NowUTC in EpochTimestamp = EpochTimestamp_Now_UTC

Three above(a, b, c) are identical, and they will hold UTC timestamp.

BUT

When u pass back into
Calendar calTmp = Calendar.getInstance();
calTmp.setTimeInMillis(milliseconds);

Sysout#1
calTmp.setTimeInMillis(a);
System.out.println(calTmp.getTime());

Sysout#2
calTmp.setTimeInMillis(c);
System.out.println(calTmp.getTime());

Sysout#1 & Sysout#2 will show your localtime.

Calendar will offset your milliseconds(a or b, which is UTC timstamp) with your timezone.
But not sure happen this offset within which part.










2021-04-19

Warning message, Failed to scan (java.io.FileNotFoundException) from: org.apache.tomcat.util.scan.StandardJarScanner


At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.|org.apache.jasper.servlet.TldScanner



Found below config is working:



Reference URL: https://stackoverflow.com/a/50743050


you can add  server.tomcat.additional-tld-skip-patterns=*.jar in application.propertiesfile or  server: tomcat: additional-tld-skip-patterns: '*.jar' in application.ymlfile.

Refer : The Jar Scanner ComponentThe official reply.









 

Google Referrals