[ 
https://issues.apache.org/jira/browse/SUREFIRE-1512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16429545#comment-16429545
 ] 

Tibor Digana commented on SUREFIRE-1512:
----------------------------------------

[~reschke]
[~michael-o]
This works for me with UTC and I do not need to transfer TZ from anywhere.
{code:java}
Calendar c1 = Calendar.getInstance( TimeZone.getTimeZone( "UTC" ), Locale.ROOT 
);
c1.set(Calendar.YEAR, 2018);
c1.set(Calendar.MONDAY, Calendar.APRIL);
c1.set(Calendar.DAY_OF_MONTH, 6);
c1.set(Calendar.HOUR_OF_DAY, 14);
c1.set(Calendar.MINUTE, 23);
c1.set(Calendar.SECOND, 27);
c1.set(Calendar.MILLISECOND, 741074 / 1000);
c1.add( Calendar.MINUTE, -1 * 120 );

Calendar c2 = Calendar.getInstance( TimeZone.getTimeZone( "UTC" ), Locale.ROOT 
);
c2.set(Calendar.YEAR, 2018);
c2.set(Calendar.MONDAY, Calendar.APRIL);
c2.set(Calendar.DAY_OF_MONTH, 6);
c2.set(Calendar.HOUR_OF_DAY, 13);
c2.set(Calendar.MINUTE, 23);
c2.set(Calendar.SECOND, 27);
c2.set(Calendar.MILLISECOND, 741074 / 1000);
c2.add( Calendar.MINUTE, -1 * 60 );

System.out.println( c1.getTimeInMillis() );
System.out.println( c2.getTimeInMillis() );
System.out.println( c1.getTimeInMillis() == 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)

Reply via email to