I'm trying to get the current date through GPS.
I created the following code:
protected override void OnResume()
{
base.OnResume();
locationManager = GetSystemService (Context.LocationService) as LocationManager;
locationManager.RequestLocationUpdates (LocationManager.GpsProvider, 1000, 1, this);
}
public void OnLocationChanged (Android.Locations.Location location)
{
Log.Debug (tag, "Location changed");
DateTime dt = new DateTime (location.Time);
txtStatusGPS.Text = dt.ToString ();
}
But the current date is coming as follows: 01/02/0001 The hour is coming, it's only going missing for a given region.
Can anyone help me?