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

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Dec 5 22:01:14 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=657609

https://bugzilla.novell.com/show_bug.cgi?id=657609#c3


--- Comment #3 from Jonathan Pryor <jpryor at novell.com> 2010-12-06 03:01:12 UTC ---
/system/usr/share/zoneinfo/zoneinfo.dat isn't appropriate.

At least, not entirely appropriate; from Androi
org.apache.harmony.luni.internal.util.ZoneInfoDB:

/**
 * A class used to initialize the time zone database.  This implementation uses
the
 * 'zoneinfo' database as the source of time zone information.  However, to
conserve
 * disk space the data for all time zones are concatenated into a single file,
and a
 * second file is used to indicate the starting position of each time zone
record.  A
 * third file indicates the version of the zoneinfo databse used to generate
the data.
 *
 * {@hide}
 */

On most Unix systems, the timezone info is stored as a directory _tree_. 
Android instead concatenates them all into a single file (zoneinfo.dat), then
uses a second file as indexes into the first (zoneinfo.idx).

In short, this means we can't trivially use the existing timezone parsing code
in mcs/class/System.Core/System/TimeZoneInfo.cs, as this is designed for
parsing a single file at a time, not a whole slew of them separately.

There's also the issue that the formats involved may change.  For example, the
TimeZoneDB.java sources mention "2007h" as being the default version, yet the
zoneinfo.version file in the Android 2.2 emulator has a value of 2009s. Does
this mean anything?  I have no idea, but it makes me leery about baking in
Android zoneinfo parsing support into mono when the version may change at any
time.

For now, I would advocate using Java.Util.TimeZone instead:

    http://developer.android.com/reference/java/util/TimeZone.html

-- 
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