[
https://issues.apache.org/jira/browse/SUREFIRE-1512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16429683#comment-16429683
]
Tibor Digana commented on SUREFIRE-1512:
----------------------------------------
This prototype works for me.
The {{millis}} is the same as from the previous prototype and if you use the
value {{1523017407741}} from {{millis}} in the page https://currentmillis.com/
you will see the date {{Fri Apr 06 2018 12:23:27}} UTC which is the same
timestamp {{20180406142327.741074+120}} CET in Germany.
{code:java}
SimpleDateFormat format = new SimpleDateFormat( "yyyyMMddHHmmss'.'SSS",
Locale.ROOT );
format.setTimeZone( TimeZone.getTimeZone( "UTC" ) );
String wmic = "20180406142327.741074+120";
Date d = format.parse( wmic.substring( 0, 18 ) );
long millis = d.getTime() - Integer.parseInt( wmic.substring( wmic.length() - 3
) ) *60 * 1000;
System.out.println( millis );
System.out.println( millis == c2.getTimeInMillis() );
{code}
> ProcessInfo for Windows is prone to timezone offset changes
> -----------------------------------------------------------
>
> Key: SUREFIRE-1512
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1512
> Project: Maven Surefire
> Issue Type: Bug
> Affects Versions: 2.21.0
> Reporter: Julian Reschke
> Assignee: Tibor Digana
> Priority: Major
>
> For some reason, on one of my machines, the current DST offset changes
> between calls. See
> <https://issues.apache.org/jira/browse/SUREFIRE-1444?focusedCommentId=16428263&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16428263>.
> This will cause surefire to think the forked VM terminated, as the string
> compare of time stamps detects a change.
> It would be good if the comparison code would actually parse the string value
> into a DST/TZ agnostic value for comparison.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)