NodaTime - Updating the time zone db

123 views
Skip to first unread message

Chistabo

unread,
Jun 9, 2016, 3:59:27 PM6/9/16
to Noda Time
Hi!

UserGuide page (http://nodatime.org/1.3.x/userguide/tzdb.html), 
Building a NodaZoneData file
paragraph 5. Run NodaTime.TzdbCompiler...

How do I do that; double clicking it just runs .exe file and closes console in a moment.
Beside, on the same web page I can only see:
path\to\NodaTime.TzdbCompiler.exe -s path\to\tzdb-files -w path\to\windowsMapping-file.xml -o path\to\ou
that is, some text is missing at the end (my web browser is set to large font).
Is there any off-line doc where this is explained more elaborately?

Best regards,
Simon
S love nia

Jon Skeet

unread,
Jun 9, 2016, 4:06:31 PM6/9/16
to Noda Time
You have to run it from the command line - that's how you pass in the command-line arguments.

Looks like the formatting on the web site is broken - but look at the markdown source to see the full command line.

Is there any particular reason you want to run this yourself rather than using one of the nzd files I've put on the web site?

Jon


--

---
You received this message because you are subscribed to the Google Groups "Noda Time" group.
To unsubscribe from this group and stop receiving emails from it, send an email to noda-time+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chistabo

unread,
Jun 9, 2016, 6:03:22 PM6/9/16
to Noda Time
Jon, no particular reason for doing it myself, except that, like before, I follow UserGuide and try to learn something on the go. Beside, I have no idea how to 'fetch' tzdb(version).nzd, and have just a minute ago figured it out how to download from 'latest.txt'.
Thanks to your reply, I did managed to compile "my own" (lol) 'tzdb-2016d.nzd', but the downloaded-one has different naming convention - 'tzdb2016d.nzd'.
Not to mention that now that I did succeeded to compile the ...2016d.nzd file, I have no idea what to do with it (how exactly to use it). Though I should not tell this aloud, since I have humiliated myself enough for today by cmd.exe-compiling from C:\. LOL. There says 'root' directory. LOL again. Yea, I know, project's root. Got it. (Though it took me a while.)

In my project, I have installed (from NuGet pckg) NodaTime, but searching (via Windows Explorer) in my project's folders, there is no *.nzd file. So I guess tzdb is somewhere embedded.
If I would want (and I will) to use this 'tzdb2016d.nzd' file, where in my project (using VS 2015 Community) should I put it, for NodaTime to be able to use it?

My goal is to code astrology software, and 2 types of DateTime will be used:
1) from user input, i.e. birth time - year-month-day hour-minute-second, and location (city/country), from which I then must extract time zone and possible DST
2) 'now' time, i.e. now time in London (no matter where in the world is the user of software situated)
I will also use SwissEphemeris (swedll32.dll; actually .NET port of it - SwissEphNet), which will get me planet's positions for that DateTime. I have 2 options - to get planet positions by local time (Julian day) or by UTC (also Julian day).
Now I need to figure it out which DateTime to use - global (UTC) or local. I guess global would be the first choice.

Btw, is there any sample code for a following:
- user would have to select the location of the event/birth - one of those from 'zone1970.tab' file (or closest one).

Long live the Jon,

Simon
S love nia

Jon Skeet

unread,
Jun 10, 2016, 2:03:07 AM6/10/16
to Noda Time
On 9 June 2016 at 23:03, Chistabo <chis...@gmail.com> wrote:
Jon, no particular reason for doing it myself, except that, like before, I follow UserGuide and try to learn something on the go. Beside, I have no idea how to 'fetch' tzdb(version).nzd, and have just a minute ago figured it out how to download from 'latest.txt'.
Thanks to your reply, I did managed to compile "my own" (lol) 'tzdb-2016d.nzd', but the downloaded-one has different naming convention - 'tzdb2016d.nzd'.
Not to mention that now that I did succeeded to compile the ...2016d.nzd file, I have no idea what to do with it (how exactly to use it). Though I should not tell this aloud, since I have humiliated myself enough for today by cmd.exe-compiling from C:\. LOL. There says 'root' directory. LOL again. Yea, I know, project's root. Got it. (Though it took me a while.)

In my project, I have installed (from NuGet pckg) NodaTime, but searching (via Windows Explorer) in my project's folders, there is no *.nzd file. So I guess tzdb is somewhere embedded.

Yes, it's in the NodaTime.dll assembly.
 
If I would want (and I will) to use this 'tzdb2016d.nzd' file, where in my project (using VS 2015 Community) should I put it, for NodaTime to be able to use it?

Anywhere you like, so long as you can open it as a Stream - then follow the "Using a NodaZoneData file" instructions in the "Updating the time zone database" guide. There's no magic place to put it for Noda Time to pick it up automatically - the only copy that will be used automatically is the one embedded in Noda Time.
 
My goal is to code astrology software, and 2 types of DateTime will be used:
1) from user input, i.e. birth time - year-month-day hour-minute-second, and location (city/country), from which I then must extract time zone and possible DST
2) 'now' time, i.e. now time in London (no matter where in the world is the user of software situated)
I will also use SwissEphemeris (swedll32.dll; actually .NET port of it - SwissEphNet), which will get me planet's positions for that DateTime. I have 2 options - to get planet positions by local time (Julian day) or by UTC (also Julian day).
Now I need to figure it out which DateTime to use - global (UTC) or local. I guess global would be the first choice.

Well using UTC is usually a better bet - particularly if the library you're using might have a different set of time zone data than the data you're using in Noda Time.
 
Btw, is there any sample code for a following:
- user would have to select the location of the event/birth - one of those from 'zone1970.tab' file (or closest one).

No, Noda Time doesn't have any kind of time zone selector built in. Picking a time zone is a tricky task, and the details depend on the kind of UI you're building.
I think Matt Johnson may have a map-based library somewhere - hopefully he can chime in with more details.

Jon

Chistabo

unread,
Jun 11, 2016, 4:13:18 PM6/11/16
to Noda Time
Quote:
"I think Matt Johnson may have a map-based library somewhere"
On NuGet, there is Dapper-NodaTime, from Matt Johnson. Could it be the one we are talking about?

Simon



On Thursday, June 9, 2016 at 9:59:27 PM UTC+2, Chistabo wrote:

Jon Skeet

unread,
Jun 11, 2016, 4:31:39 PM6/11/16
to Noda Time

No, I that's Noda Time support for Dapper...

--

Chistabo

unread,
Jun 12, 2016, 6:13:45 AM6/12/16
to Noda Time
GeoTimeZone would be the one. Both (this one and below mentioned Dapper) link to Matt Johnson's GeoTimeZone GitHub page.

Simon


On Thursday, June 9, 2016 at 9:59:27 PM UTC+2, Chistabo wrote:

Matt Johnson

unread,
Jun 12, 2016, 8:28:21 PM6/12/16
to Noda Time
Sorry, just saw this thread.  Yes, GeoTimeZone will help you choose an IANA time zone from latitude and longitude coordinates.  It uses the tz_world data set from http://efele.net/maps/tz/world/

Once you have the IANA time zone ID, you can easily use it with Noda Time.

-Matt

Chistabo

unread,
Jun 15, 2016, 6:55:21 AM6/15/16
to Noda Time
I have already implemente GeoTimeZone, and it works like a charm. Thank you.

Simon
S love nia


On Thursday, June 9, 2016 at 9:59:27 PM UTC+2, Chistabo wrote:
Reply all
Reply to author
Forward
0 new messages