[Mono-bugs] [Bug 657609] New: System.TimeZoneNotFoundException when accessing TimeZoneInfo.Local in Emulator and on Device

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Dec 4 15:56:55 EST 2010



           Summary: System.TimeZoneNotFoundException when accessing
                    TimeZoneInfo.Local in Emulator and on Device
    Classification: Mono
           Product: MonoDroid
           Version: unspecified
          Platform: x86-64
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mkestner at novell.com
        ReportedBy: info at flurischt.ch
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

Created an attachment (id=403463)
 --> (http://bugzilla.novell.com/attachment.cgi?id=403463)
the ADB log output while running the reported testcase

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.13
(KHTML, like Gecko) Chrome/9.0.597.0 Safari/534.13


the following code fails with a System.TimeZoneNotFoundException on my Motorola
Milestone and also in the Emulator on a Win7:

 using System;

 using Android.App;
 using Android.Content;
 using Android.Runtime;
 using Android.Views;
 using Android.Widget;
 using Android.OS;

 namespace HelloAndroid
    [Activity(Label = "My Activity", MainLauncher = true)]
    public class Activity1 : Activity
        protected override void OnCreate(Bundle bundle)

            // Set our view from the "main" layout resource

            TextView tv = FindViewById<TextView(Resource.id.txtHello);
            tv.Text = TimeZoneInfo.Local.ToString();

I have attached the output of ddms while running the activity.
It looks like the same problem that was reported here:

Reproducible: Always

Steps to Reproduce:
1. use code that uess TimeZoneInfo.Local (see example above)
2. run it
Actual Results:  
a System.TimeZoneNotFoundException is thrown

Expected Results:  
no Exception

on the monodroid mailing list I got the following feedback by Jon:

Please file a bug with this test case so we can track it.

Looking at the code, it fails because your device is missing /etc/localtime,
and Google is showing that this is a common problem (i.e. lots of people have
hit this before with C code).

A cursory inspection of Google results doesn't show a satisfactory answer (much
less _any_ answer), but a quick perusal of the emulator filesystem shows that
/system/usr/share/zoneinfo/zoneinfo.dat _might_ be appropriate.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list