3232import java .io .FileOutputStream ;
3333import java .io .InputStream ;
3434import java .nio .charset .Charset ;
35- import java .util .Date ;
3635import java .util .HashMap ;
3736import java .util .List ;
3837import java .util .Map ;
4140import java .util .concurrent .TimeUnit ;
4241
4342import io .sentry .Breadcrumb ;
43+ import io .sentry .DateUtils ;
4444import io .sentry .HubAdapter ;
4545import io .sentry .ILogger ;
4646import io .sentry .Integration ;
4747import io .sentry .Sentry ;
48+ import io .sentry .SentryDate ;
4849import io .sentry .SentryEvent ;
4950import io .sentry .SentryLevel ;
5051import io .sentry .UncaughtExceptionHandlerIntegration ;
@@ -234,7 +235,7 @@ public void fetchNativeRelease(Promise promise) {
234235 @ ReactMethod
235236 public void fetchNativeAppStart (Promise promise ) {
236237 final AppStartState appStartInstance = AppStartState .getInstance ();
237- final Date appStartTime = appStartInstance .getAppStartTime ();
238+ final SentryDate appStartTime = appStartInstance .getAppStartTime ();
238239 final Boolean isColdStart = appStartInstance .isColdStart ();
239240
240241 if (appStartTime == null ) {
@@ -244,11 +245,11 @@ public void fetchNativeAppStart(Promise promise) {
244245 logger .log (SentryLevel .WARNING , "App start won't be sent due to missing isColdStart." );
245246 promise .resolve (null );
246247 } else {
247- final double appStartTimestamp = ( double ) appStartTime .getTime ( );
248+ final double appStartTimestampMs = DateUtils . nanosToMillis ( appStartTime .nanoTimestamp () );
248249
249250 WritableMap appStart = Arguments .createMap ();
250251
251- appStart .putDouble ("appStartTime" , appStartTimestamp );
252+ appStart .putDouble ("appStartTime" , appStartTimestampMs );
252253 appStart .putBoolean ("isColdStart" , isColdStart );
253254 appStart .putBoolean ("didFetchAppStart" , didFetchAppStart );
254255
0 commit comments