Friday, March 29, 2013

Terminally geeky: When is Lord Howe Island?

In just over a month I will be travelling to Australia's Lord Howe Island, a World Heritage-listed island in the Tasman Sea. I'll be spending a week there with just over a dozen other photographers. Some of us will be concentrating on the wildlife, some on the landscape opportunities, and some of us will be concentrating on all of it!

In preparing for the trip, I came across a problem with the Apple OS X operating system (used on my laptop and desktop systems). While the zoneinfo timezone database included in OS X (and in many other Unix variants such as Linux) knows about the Lord Howe Island timezone, the operating system didn't allow me to choose it! I did find a solution, but in case you're wondering why this is an important problem, let me first go back to basics.

Devices
Many cameras have no concept of timezone, just "the current time". Some cameras have a concept of timezones, allowing you to have a "home" and a "destination" timezone and switch between them as required. Especially cameras with GPS units (as the GPS doesn't know about timezones by itself). Whatever the features of the camera, the time recorded on a photo usually doesn't have timezone information.
Thus when I enter a new timezone I update my cameras so they're recording "local" time. When I look at a photo taken in this location which says it was taken at "4pm" I don't have to keep converting it from some central time standard to put it in the context of that day. Having accurate time in my cameras is also important as it allows me to geocode my photos.
The way I achieve both of these is to set the timezone on my laptop to the appropriate local timezone (including daylight savings, etc) and then connect the cameras to the laptop via USB and set their time. The time in the computer will have been automatically set recently via the Network Time Protocol (NTP) to an atomic clock source across the Internet (and if I'm away from the Internet for long periods I can do the same using my GPS).

Calendars
I use OS X's Calendar program to track my appointments, and it's synchronised with the calendars on my iPhone and iPad. As well as keeping track of meetings in my home town, I use this "on the road" too. The calendar knows about timezones, and appointments can be marked as being in a particular timezone. One place I use this is to keep track of my flights across different timezones.
Take this example from my recent trip to Hawaii. The flight from Melbourne to Honolulu is in the Melbourne timezone, so I can see that it leaves at 16:30 and arrives 11.5 hours later (03:00 in Melbourne time).
If I switch the calendar's timezone to Honolulu I can see it arrives at 06:00 (on the day I departed), and my connecting flight to Kahului is at 09:30. Three and a half hours should be enough time to be fingerprinted by Border Protection, collect our bags, transit to the other terminal, and get patted down by the TSA, right? In the end it was a comfortable amount of time, especially as our first flight ran slightly late.
This does mean that when I enter a new timezone I have to change the system timezones on my laptop, iPhone, and iPad, and change the calendar timezones on each of these devices too. But I'm not changing the actual time so the minutes/seconds/etc should still be accurate.

Setting the OS X calendar timezone
The iOS system timezone
The iOS calendar timezone
Setting the OS X system timezone


Daylight Savings
The zoneinfo timezone database used on Unix, OS X, and iOS devices automagically handles daylight savings conversions so when daylight savings starts/ends, although I still have to change the time in non-timezone-aware devices like my cameras, insulin pump, and blood glucose meter, I don't have to change my laptop or phone/tablet. It also means that appointments made either side of daylight savings work as expected.

Lord Howe Island's timezone
Setting iOS timezone
The timezone of Lord Howe Island is a unique beast. The offset from UTC is normally +10:30, but during daylight savings it's UTC+11:00. In comparison, in Melbourne these values are UTC+10:00 and UTC+11:00. So if I was visiting the island during daylight savings I could have ignored the issue altogether. Unfortunately not.
I will need to set the system timezone on OS X to Lord Howe Island time when I arrive but well before that, I at least want to set the calendar timezone to Lord Howe Island while doing my travel planning. This is easily done on iOS devices, as you just need to type in the location "lord" and the system prompts you with the timezone.
On OS X (at least as at OS X 10.8.3) you need to set the timezone via pointing at the location on a map of the world (see the example above): there's no easy shortcut to type in the timezone name. However Lord Howe Island is not a recognised place on the map! And there are no other locations with a UTC+10:30 timezone we can cheat with.
Fixing OS X

Luckily it turns out it's not too hard to add Lord Howe Island's location to the map, after which everything falls into place. Do note however that this requires a bit of "geekery" at a Terminal shell prompt, and obviously you need Administrator access to the machine. If you go down this path be very careful to type in the commands exactly as I've given them.

There's a SQLite database buried down within a version of the GeoKit framework, and we need to add a record to it. From within Terminal.app, run the following command (all on one line):
sudo sqlite3 /System/Library/PrivateFrameworks/GeoKit.framework/Versions/A/Resources/world.geokit
The command will prompt you for your password (to prove you have admin access) and then you'll be sitting within the sqlite3 program with the database open. Now we can issue some SQL database commands.

Just to be sure there's no Lord Howe record in there already:
SELECT * FROM ZGEOKITPLACE WHERE ZTIMEZONENAME = 'Australia/Lord_Howe';
Presumably this will return no records. If it is in there already, you probably don't need to do any of this and can .quit now.

Otherwise we need to add the record. Several of the values I'm suggesting in this record are very arbitrary, and hopefully a proper record will be included in the database in the future. But this works for now. Again, this command is all on one line.
INSERT INTO ZGEOKITPLACE VALUES (23901, 2, 1, 0, 2147714, 700, 0, 0, 5004, null, -31.5325, 159.07, 'Lord Howe', null, 'Australia/Lord_Howe', null, null);
Then .quit,  and you're done. That's it!

Lord Howe Island now selectable!
Note that this modification has only been tested on OS X 10.8.2 and 10.8.3. Hopefully in a future update to the operating system you won't have to do this (unless you find another unselectable timezone you need).

Cameras with timezones
It's worth noting that although my Panasonic infrared camera has Home/Destination timezones, it has no UTC+10:30 zone. So if I take that to Lord Howe Island I will have to adjust its time manually. I'm wondering what would happen if I was using a GP-E2 GPS attached to an EOS 5D MkIII camera (does it have a UTC+10:30 timezone?) but with my external GPS recorders I won't have to deal with this problem myself.
Incidentally, the timezones involved in my Botswana expedition later in the year are already selectable. They're in areas populous enough that OS X as well as all the cameras with timezones will support them. 

1 comment:

Paul Holt said...

Love me some SQLite!

Post a Comment