title: Making the user change the time in Android
body: <p>Android doesn't appear to provide a way for a <a href="https://stackoverflow.com/questions/1332269/how-to-set-mobile-system-time-and-date-in-android">user application to change the system time</a>. What I would like to do instead is to get the user to change the time. It is easy to open up the Date &amp; Time settings:</p>
  
  <pre><code>startActivity(new Intent(android.provider.Settings.ACTION_DATE_SETTINGS));
  </code></pre>
  
  <p>What I would like to know is:</p>
  
  <ol>
  <li>Is it possible to link directly to the set time option?</li>
  <li>Is it possible to check that the user set the time correctly? I am aware of the <code>TIME_CHANGED</code> broadcast message, but I can't find any documentation on it</li>
  </ol>
  
  <p><strong>Update:</strong></p>
  
  <p>The TIME_CHANGED broadcast message doesn't provide any information about how it changed. This isn't explicitly documented, but I tried <code>getData</code> and <code>getExtras</code> and received no information. Additionally, looking at the rest of the <a href="https://stackoverflow.com/questions/2808325/documentation-for-extra-in-intents-for-android">documentation</a> it appears that no data or extras are passed unless explicitly documented. Similarly, it is actually <a href="http://developer.android.com/reference/android/provider/Settings.html#ACTION_DATE_SETTINGS" rel="nofollow noreferrer">documented</a> the <code>ACTION_DATE_SETTINGS</code> takes no input and it is implicit that it takes no extras, so there is no way to control it more precisely.</p>
  
  <p><a href="https://stackoverflow.com/questions/2799761/making-the-user-change-the-time-in-android/2802321#2802321">CommonsWare</a> pointed out what should have been obvious to me - that simply checking that the user set the time to the value retrieved from the server, without worrying about the time spent in the options menu, will almost always work. As this assumption could actually be false, if I were using this method, then I would ensure the message said that the time was <em>probably</em> set correctly or incorrectly, rather than using a definite statement.</p>
  
  <p>However, I discovered <a href="http://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime%28%29" rel="nofollow noreferrer">elapsedRealtime</a> and so I will actually implement this detection properly.</p>