Skip to content
Snippets Groups Projects
Commit 38415082 authored by Yan Yan's avatar Yan Yan Committed by Gerrit Code Review
Browse files

Merge "Fix StructXfrmLifetimeCurTest failure when default timezone is not GMT" into main

parents 452feb26 17b7a740
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ import java.math.BigInteger; ...@@ -31,6 +31,7 @@ import java.math.BigInteger;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.util.Calendar; import java.util.Calendar;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class) @RunWith(AndroidJUnit4.class)
...@@ -42,7 +43,7 @@ public class StructXfrmLifetimeCurTest { ...@@ -42,7 +43,7 @@ public class StructXfrmLifetimeCurTest {
private static final BigInteger ADD_TIME; private static final BigInteger ADD_TIME;
static { static {
final Calendar cal = Calendar.getInstance(); final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
cal.set(2023, Calendar.NOVEMBER, 2, 1, 42, 36); cal.set(2023, Calendar.NOVEMBER, 2, 1, 42, 36);
final long timestampSeconds = TimeUnit.MILLISECONDS.toSeconds(cal.getTimeInMillis()); final long timestampSeconds = TimeUnit.MILLISECONDS.toSeconds(cal.getTimeInMillis());
ADD_TIME = BigInteger.valueOf(timestampSeconds); ADD_TIME = BigInteger.valueOf(timestampSeconds);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment