title: How do we refresh /.info/serverTimeOffset on device time change?
body: <p>I am using /.info/serverTimeOffset to get the approximate server time from firebase.</p>
  
  <pre><code>Long clockSkew = null;
  ...
  void registerForClockSkew() {
    DatabaseReference offsetRef = 
    FirebaseDatabase.getInstance().getReference(".info/serverTimeOffset");
    offsetRef.addValueEventListener(new ValueEventListener() {
      @Override
      public void onDataChange(DataSnapshot snapshot) {
        double offset = snapshot.getValue(Double.class);
        clockSkew = (long) offset;
      }
  
      @Override
      public void onCancelled(DatabaseError error) {
        clockSkew = null;
      }
    });
  }
  </code></pre>
  
  <p>However as mentioned here - <a href="https://github.com/firebase/firebase-ios-sdk/issues/363" rel="nofollow noreferrer">https://github.com/firebase/firebase-ios-sdk/issues/363</a> - the offset does not refresh when there is a device-time-change. I have tried to close and reconnect firebase instance to refresh the skew value but it does not seem to be working. In my code I simply put the following when there is device time change -</p>
  
  <pre><code>FirebaseDatabase.getInstance().goOffline();
  FirebaseDatabase.getInstance().goOnline();
  </code></pre>
  
  <p>but this does not trigger the value-event-listener callback. What am I missing here? Is it because goOffline and goOnline are consecutive statements, it is not having any effect?</p>