Author Topic: get exact tzcode  (Read 568 times)

0 Members and 1 Guest are viewing this topic.

monliv

  • Newbie
  • *
  • Posts: 30
    • View Profile
get exact tzcode
« on: January 29, 2024, 09:41:33 AM »
Hey Jean,
With the string strset(s, "%s, %s, %s,%s",place,nation,lonstr,latstr,capital);
and with the command sethoroscopeplace(), I transfer the data to enter the place.

With the command strcmd(30, 0, s);I extract the exact time zone of the place.
Unfortunately, it only works if i resume the theme and confirm the place via getplace()

In dos for a program done in the past, I used to read INTNDX.BIN with a call.
I see that you also get from tz.bin but I don't know how to do it in pd.


Can you tell me how can I get the right tzone value ? 0-415 ?

strset(s, "%s, %s, %s,%s",place,nation,lonstr,latstr,tzcode);
ex: strset(s, "Santo Stefano Belbo, Italy, 8e14, 44n42,346");

and immediately have the right zone location (CST,EDT or CWT etc) in the output.

Perhaps a list of tzcodes and continent/capital would suffice ?

Jean

  • Administrator
  • Hero Member
  • *****
  • Posts: 1086
    • View Profile
Re: get exact tzcode
« Reply #1 on: January 29, 2024, 11:19:00 AM »
i don't know if i understand exactly what you're asking but mostly you just use getimezone().
Greetings from Groningen Netherlands <)))><.`.><(((>

monliv

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: get exact tzcode
« Reply #2 on: January 29, 2024, 04:04:30 PM »
difficult example in Italian, even more so in English.
I take a theme at random,

Cambi, Livio D.:14/06/1885 T.:07:00:00 A.:+00.832 RMT Lat.:43n36 Long.:13e31 Place:Ancona,Italy,Europe/Rome

I have this subject, born in Ancona on 14/06/1885 at 07:00:00 Delta +00.832 RMT <<<<< ZONES

I compose the string with the data for Ancona
strset(s, "Ancona, Italy, 13e31, 43n36,Europe/Rome") .
and with the sethoroscopeplace() command, I transfer the data to enter the place,
as well as the jd, and everything else needed.

I confirm and register the theme in planetdance.

a) If i go in planetdance, and review with edit, i call up the city and save.
   I call up the theme from code, with the strcmd(30, 0, s) procedure, I get this string back with correct zones 'RMT'.

Cambi, Livio D.:14/06/1885 T.:07:00:00 A.:+00.832 RMT Lat.:43n36 Long.:13e31 Place:Ancona,Italy,Europe/Rome

(b) I don't use getplace().
   It seems that it is not possible to assign the 'zones' correctly, because the command strcmd(30, 0, s); contains 0,
and so I do not get 'RMT' but have to write a generic TZ.
I was thinking of introdding TZCODE separately by reading the state capital.
I found an example in ImportAndroid.ab at line 66, where you mention tzcode
if (tzcode < 0 || tzcode > 415)
Tell me if the example is clear to you and if there may be a solution.

Jean

  • Administrator
  • Hero Member
  • *****
  • Posts: 1086
    • View Profile
Re: get exact tzcode
« Reply #3 on: January 29, 2024, 05:20:58 PM »
look at the help for gethoroscopeplace.

Code: [Select]
gethoroscopeplace(char Index, char Name[], char flag);
Action: Gets the placename from horoscope 'Index' into the array 'Name'. If flag = 0, the timezone is returned, else the name is returned

This means that you either get
Kerkrade, Netherlands, 6e04, 50n52,310
or
Kerkrade, Netherlands, 6e04, 50n52, Europe/Amsterdam

The first version has timezonecode 310 and the place in gettimezone(place, jd) should have this timezonecode. If you construct a place yourself it has to have the correct code. You can see the timezones with strcmd(0, n

The strcmd(30, only gets the timezone abbreviation stored in the chart.
Greetings from Groningen Netherlands <)))><.`.><(((>

monliv

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: get exact tzcode
« Reply #4 on: January 29, 2024, 07:01:28 PM »
ok
thanks