> For clarity, my 2 example lines should result in:
Thanks for the test cases. I didn't get that is was 100 ns intervals.
Here is the correct code:
public static void main(String[] args) {
long[] windowsEpochVals = { 130379098763733422L, 130379098763889429L, 130379691525956712L };
// diff between Windows epoch and the Java epoch (in seconds)
// see
https://svn.apache.org/repos/asf/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/Util/DateUtils.cs
long epochDiff = 11644473600L;
for (int i = 0; i < windowsEpochVals.length; i++) {
long windowsEpoch = windowsEpochVals[i];
long unixEpochInSec = (windowsEpoch / 10000000L) - epochDiff;
Date date = new Date(unixEpochInSec * 1000L);
System.out.println(windowsEpoch + " --> " + date + " (" + unixEpochInSec + ")");
}
}
Output:
130379098763733422 --> Wed Feb 26 18:37:56 CET 2014 (1393436276)
130379098763889429 --> Wed Feb 26 18:37:56 CET 2014 (1393436276)
130379691525956712 --> Thu Feb 27 11:05:52 CET 2014 (1393495552)
> Thinking about best way to use in or before Megatron processing.
Give it a try to call the Perl-script from Megatron, e.g.:
fileProcessor.classNames.0=se.sitic.megatron.fileprocessor.OsCommandProcessor
fileProcessor.osCommandProcessor.command=perl
convert-timestamps.pl $inputFile
/Tor