[mono-android] Set Device date and Time

Tomasz Cielecki tomasz at ostebaronen.dk
Fri Jun 15 07:54:43 UTC 2012


Or invoke adb shell date -s YYYYMMDD.HHmmss that could work as well.
Either way I think you would need root.

A better way would be to launch the settings activity with the date settings:

StartActivity(new Intent(Android.Provider.Settings.ActionDateSettings));

On Fri, Jun 15, 2012 at 12:47 AM, Jonathan Pryor <jonp at xamarin.com> wrote:
> On Jun 14, 2012, at 11:45 AM, Nosh wrote:
>> Any ideas on how to set the device date and time via code
>
> You probably don't.
>
> You could probably P/Invoke settimeofday(2), but that requires that you be root, so unless you happen to be running as the root user it won't do any good.
>
>        http://linux.die.net/man/2/settimeofday
>
>  - Jon
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid



-- 
Med Venlig Hilsen / With Best Regards
Tomasz Cielecki
http://ostebaronen.dk


More information about the Monodroid mailing list