title: Why are Date.now() and System.currentTimeMillis() returning different values?
body: <p>I have an android app and a web app which are connected together. On clicking a button in the web app, a notification is instantly sent to the android app. The moment the button on the web app is clicked, I need to record the current time in both apps.</p>
  <p>On the web app I'm using Date.now() to record the time. And in the android app I'm using System.currentTimeMillis() to record the time. When the button is clicked in the web app, it only takes a couple seconds for the notification to reach the android app. Hence, the time recorded in both places must differ by only a few seconds.</p>
  <p>But the following timestamps are getting recorded in both places:</p>
  <pre><code>Web app- using Date.now() - 1653945533308
  
  Android app- using System.currentTimeMillis() - 1653945810727
  </code></pre>
  <p>These timestamps have a difference of 5 minutes, which is wrong. It looks like for some reason, the timestamps getting logged by the 2 apis are not exactly the same at the same time.</p>
  <p>Why is this happening? Is there a way to ensure that &quot;Date.now() in javascript&quot; and &quot;System.currentTimeMillis() in java&quot; both record the same timestamp at the same time?</p>