Skip to main content

Configuring timezones

7 replies [Last post]
noky
Offline
Joined: 2005-05-20
Points: 0

I have been using phoneME Advanced MR2 b34 successfully for a while now but have one minor problem: it seems that only a few timezones are configured. How do I update the configured timezones? For the record, I ran a test program (see http://exampledepot.com/egs/java.util/GetAllZones.html) and got this result:

America/Los_Angeles, PDT, Pacific Daylight Time -8:0
PST, PDT, Pacific Daylight Time -8:0
GMT, GMT, Greenwich Mean Time 0:0
UTC, UTC, Coordinated Universal Time 0:0
Asia/Calcutta, IST, India Standard Time 5:30
IST, IST, India Standard Time 5:30
Asia/Novosibirsk, NOVT, Novosibirsk Time 6:0

I was counting on the fact that some basic timezones would be configured, such as EST5EDT, CST6CDT, MST7MDT, PST8PDT. How can I configure these?

Mike

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cjplummer
Offline
Joined: 2006-10-16
Points: 0

I don't fully understand how it all works, but if you look in defs_zoneinfo.mk, you will see the following:

# This is for full timezone support all timezones. This isn't
# ideal for J2ME as this is about 240k.
#TZFILE = \
# africa antarctica asia australasia europe northamerica \
# pacificnew southamerica systemv backward \
# etcetera solar87 solar88 solar89 systemv

# We are restricting timezone support to just certain timezones
# as samples for J2ME CDC/Foundation Profile reference,
# America/Los_Angeles, Asia/Calcutta and Asia/Novosibirsk.
# This is to save space for J2ME builds.
TZFILE = j2meref
JDKTZDATA = $(CVM_SHAREROOT)/tools/javazic/tzdata_jdk/
JDKTZFILES = gmt jdk11_backward
TZFILES = \
$(addprefix $(TZDATA),$(TZFILE)) \
$(addprefix $(JDKTZDATA),$(JDKTZFILES))

So the set is intentionally restricted for footprint reasons, but I don't believe there is anything in the cdc spec that prevents you from including all timezones. Also, I think the timezone info you need is probably in the cdc source under src/share/tools/javazic, and you just need to tweak the above makefile code to use it.

I also think that keeping the extra timeszone out for footprint reasons is probably not a good idea, especially as a default. I find it hard to believe the timezones use all that much footprint compared to the overall size of the stack. At the very least it would be nice if there was a build option to control whether or not you get all the timezones. If you figure out how to get all the timezones added, let me know and I'll see if I can make it a build option.

Chirs

cjplummer
Offline
Joined: 2006-10-16
Points: 0

I take that back. I see now all timezones use 240k, which is kind of a lot. Maybe there is a better middle ground here that includes all major timezones from around the world, but not quite so many cities from within those timezones. Still, a build option to includes all timezones would be nice.

Chris

hinkmond
Offline
Joined: 2003-12-01
Points: 0

Hi Chris,

You're right about the CDC/Foundation Profile specs. not requiring anything about which timezones you include or exclude. So, it's up to you to build in which ones you want into the CDC/CVM stack.

You can control this by uncommenting and commenting lines in the file you pointed out.

For example to include all, uncomment these lines:

defs_zoneinfo.mk
---

# This is for full timezone support all timezones. This isn't
# ideal for J2ME as this is about 240k.
TZFILE = \
africa antarctica asia australasia europe northamerica \
pacificnew southamerica systemv backward \
etcetera solar87 solar88 solar89 systemv

and comment out this line:

#TZFILE = j2meref

The TZ files contain which timezones you want to include, line by line for each timezone of a different geo area (like africa or americas, etc.). So by including all the continents plus some extras (in the above now uncommented lines) files, you get all the timezone line entries from the given TZ files (like africa, northamerica, etc., etc.) and will get the same full set that Java SE has.

Hinkmond

noky
Offline
Joined: 2005-05-20
Points: 0

Thank you both for the clear, concise directions. This worked perfectly.

Mike

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Thank you both for the clear, concise directions. This worked perfectly.
>
>
> Mike
>

Hi Mike,

Glad it worked for you. If you have the chance and don't mind sharing,
please let us know how you are using the phoneME Advanced software. It
sounds interesting that you are using the full set of timezones and not
just a smaller targeted set (like northamerica or europe or asia).

Are you porting pMEA to a device that will be deployed in more than one
country? It's always fun to hear how Java ME is being used in many
different ways now that it has been open sourced with phoneME.

Thanks,
Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

noky
Offline
Joined: 2005-05-20
Points: 0

Hi Hinkmond,

I am developing a sign application for the public transit sector, which shows vehicle arrival times, messages, time of day, etc. The product will be used for customers in north america (US and Canada), but we expect to expand into other locations as well. Since our platform has plenty of flash storage, it was just easier to use all the timezones now and not have to worry about adding them later for new customers.

Mike

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Hi Hinkmond,
>
> I am developing a sign application for the public transit sector, which shows vehicle arrival times, messages, time of day, etc. The product will be used for customers in north america (US and Canada), but we expect to expand into other locations as well. Since our platform has plenty of flash storage, it was just easier to use all the timezones now and not have to worry about adding them later for new customers.
>

Very cool! :-) Please let us know on this forum if you have any other
questions or problems for your project and how it all turns out. You're
right that flash storage is cheap now on small devices, so why not take
advantage of it.

Good luck on your project!

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net