Local Time (zone) from coords and time (OT)

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Local Time (zone) from coords and time (OT)

Greg-110
Is there a source for determining local time or offset from GMT from the coords and time? And by that I mean something accessible from a script. I want to label the logs for Garmin tracks with the local time (and eventually location). I wouldn't expect this to be part of GPSBabel, but this is hard to search for, at least for me.

Thanks
------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Local Time (zone) from coords and time (OT)

Jan Martin-6
There seem to be a lot of ways to do this:

http://www.google.de/search?q=timezone+from+latitude+longitude&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:official&client=firefox-a

Jan

On Fri, May 14, 2010 at 7:22 PM, Greg <[hidden email]> wrote:
Is there a source for determining local time or offset from GMT from the coords and time? And by that I mean something accessible from a script. I want to label the logs for Garmin tracks with the local time (and eventually location). I wouldn't expect this to be part of GPSBabel, but this is hard to search for, at least for me.

Thanks
------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc



--
http://www.DIY-streetview.org

------------------------------------------------------------------------------


_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Local Time (zone) from coords and time (OT)

Robert Lipe-4
In reply to this post by Greg-110


On Fri, May 14, 2010 at 12:22 PM, Greg <[hidden email]> wrote:
Is there a source for determining local time or offset from GMT from the coords and time? And by that I mean something accessible from a script. I want to label the logs for Garmin tracks with the local time (and eventually location). I wouldn't expect this to be part of GPSBabel, but this is hard to search for, at least for me.


------------------------------------------------------------------------------


_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Local Time (zone) from coords and time (OT)

Greg-110
In reply to this post by Jan Martin-6
Thanks Jan and Robert

All in knowing the search words or having the knowledge.

Greg

On May 14, 2010, at 10:45 AM, Jan Martin wrote:

There seem to be a lot of ways to do this:

http://www.google.de/search?q=timezone+from+latitude+longitude&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:official&client=firefox-a

Jan

On Fri, May 14, 2010 at 7:22 PM, Greg <[hidden email]> wrote:
Is there a source for determining local time or offset from GMT from the coords and time? And by that I mean something accessible from a script. I want to label the logs for Garmin tracks with the local time (and eventually location). I wouldn't expect this to be part of GPSBabel, but this is hard to search for, at least for me.

Thanks
------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc



--
http://www.DIY-streetview.org
------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc


------------------------------------------------------------------------------


_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Local Time (zone) from coords and time (OT)

Greg-110
In reply to this post by Jan Martin-6
I wrote too soon. I don't see what I asked for: Time Zone (or local time) given lat, long, and a date-time (GMT) in the past from some service or database. An example: Given -118 long, 34 lat and 2010-02-11 14:12:15 what was the time offset from GMT (or what was the local time then considering daylight savings).

I'll continuing searching if no one has a ready answer

On May 14, 2010, at 10:45 AM, Jan Martin wrote:

There seem to be a lot of ways to do this:

http://www.google.de/search?q=timezone+from+latitude+longitude&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:official&client=firefox-a

Jan

On Fri, May 14, 2010 at 7:22 PM, Greg <[hidden email]> wrote:
Is there a source for determining local time or offset from GMT from the coords and time? And by that I mean something accessible from a script. I want to label the logs for Garmin tracks with the local time (and eventually location). I wouldn't expect this to be part of GPSBabel, but this is hard to search for, at least for me.

Thanks
------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc



--
http://www.DIY-streetview.org
------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc


------------------------------------------------------------------------------


_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Local Time (zone) from coords and time (OT)

Tom Paton
I think you'll have to combine two sources, first use a webservice (or
download a database) like
http://www.geonames.org/export/web-services.html#timezone

This will give you the timezone, you should then be able to use the
Olson database http://en.wikipedia.org/wiki/Tzdata (via Python's pytz
module or the equivalent in your favourite language) to get the local
time in the timezone for the given date.

Tom

On Sat, May 15, 2010 at 9:34 AM, Greg <[hidden email]> wrote:

> I wrote too soon. I don't see what I asked for: Time Zone (or local time)
> given lat, long, and a date-time (GMT) in the past from some service or
> database. An example: Given -118 long, 34 lat and 2010-02-11 14:12:15 what
> was the time offset from GMT (or what was the local time then considering
> daylight savings).
> I'll continuing searching if no one has a ready answer
>
> On May 14, 2010, at 10:45 AM, Jan Martin wrote:
>
> There seem to be a lot of ways to do this:
>
> http://www.google.de/search?q=timezone+from+latitude+longitude&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:official&client=firefox-a
>
> Jan
>
> On Fri, May 14, 2010 at 7:22 PM, Greg <[hidden email]> wrote:
>>
>> Is there a source for determining local time or offset from GMT from the
>> coords and time? And by that I mean something accessible from a script. I
>> want to label the logs for Garmin tracks with the local time (and eventually
>> location). I wouldn't expect this to be part of GPSBabel, but this is hard
>> to search for, at least for me.
>>
>> Thanks
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Gpsbabel-misc mailing list http://www.gpsbabel.org
>> [hidden email]
>> To unsubscribe, change list options, or see archives, visit:
>> https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
>
>
>
> --
> http://www.DIY-streetview.org
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Gpsbabel-misc mailing list http://www.gpsbabel.org
> [hidden email]
> To unsubscribe, change list options, or see archives, visit:
> https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Gpsbabel-misc mailing list http://www.gpsbabel.org
> [hidden email]
> To unsubscribe, change list options, or see archives, visit:
> https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
>
>

------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Local Time (zone) from coords and time (OT)

Greg-110
These should me closer. I wish they worked in GMT offsets rather than named time zones, but I'll work on it.

Greg

On May 14, 2010, at 4:48 PM, Tom Paton wrote:

> I think you'll have to combine two sources, first use a webservice (or
> download a database) like
> http://www.geonames.org/export/web-services.html#timezone
>
> This will give you the timezone, you should then be able to use the
> Olson database http://en.wikipedia.org/wiki/Tzdata (via Python's pytz
> module or the equivalent in your favourite language) to get the local
> time in the timezone for the given date.
>
> Tom
>
> On Sat, May 15, 2010 at 9:34 AM, Greg <[hidden email]> wrote:
>> I wrote too soon. I don't see what I asked for: Time Zone (or local time)
>> given lat, long, and a date-time (GMT) in the past from some service or
>> database. An example: Given -118 long, 34 lat and 2010-02-11 14:12:15 what
>> was the time offset from GMT (or what was the local time then considering
>> daylight savings).
>> I'll continuing searching if no one has a ready answer
>>
>> On May 14, 2010, at 10:45 AM, Jan Martin wrote:
>>
>> There seem to be a lot of ways to do this:
>>
>> http://www.google.de/search?q=timezone+from+latitude+longitude&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:official&client=firefox-a
>>
>> Jan
>>
>> On Fri, May 14, 2010 at 7:22 PM, Greg <[hidden email]> wrote:
>>>
>>> Is there a source for determining local time or offset from GMT from the
>>> coords and time? And by that I mean something accessible from a script. I
>>> want to label the logs for Garmin tracks with the local time (and eventually
>>> location). I wouldn't expect this to be part of GPSBabel, but this is hard
>>> to search for, at least for me.
>>>
>>> Thanks
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Gpsbabel-misc mailing list http://www.gpsbabel.org
>>> [hidden email]
>>> To unsubscribe, change list options, or see archives, visit:
>>> https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc


------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Local Time (zone) from coords and time (OT)

John Robert Peterson
I may be missing something fundemental here -- but the earth tools things seems to do exactly what you are after.

note the terms and conditions (no more than one call, and strict rules about result cashing)

use wget or curl to call it by coords, then extract the "offset" value (bash code below will do it for a similar web service, it's extracted from another program, so it won't work without tweaking -- it's a bodge, but for simple cases like this it should work)

You will then have to add this value to the time in question, which may be slightly tricky depending on whether there is any tool desgned to do that (i've never played with that)

        nrby=`curl "<a href="http://ws.geonames.org/findNearbyPlaceName?lat=${lin%,*}&amp;lng=${lin#*,}&amp;style=full">http://ws.geonames.org/findNearbyPlaceName?lat=${lin%,*}&lng=${lin#*,}&style=full"`
                                     # lin is the input coords in "170.1,30.3" format parsed using substrings
        for x in $nrby                        # for each line in response
        do
            if [[ "$x" == *countryName* ]]; then               # if line contains the string countryName
                #    ${x%*<}                    #        %\<*\>
                xb=${x#\<*\>}                                          # use substrings to remove the xml tags from around the data
                xf=${xb%\<*\>}
                keywords="$keywords$FS$xf"                  # add the result to a long comma separated list (FB contains a single comma)
                descr="$descr$FS$xf"
            fi
            if [[ "$x" == *adminName* ]] || [[ "$x" == *\<name\>* ]]; then    # repeat for another keyword
                #    ${x%*<}                    #        %\<*\>
                xb=${x#\<*\>}
                keywords="$keywords$FS${xb%\<*\>}"
            fi
        done


On 15 May 2010 02:52, Greg <[hidden email]> wrote:
These should me closer. I wish they worked in GMT offsets rather than named time zones, but I'll work on it.

Greg

On May 14, 2010, at 4:48 PM, Tom Paton wrote:

> I think you'll have to combine two sources, first use a webservice (or
> download a database) like
> http://www.geonames.org/export/web-services.html#timezone
>
> This will give you the timezone, you should then be able to use the
> Olson database http://en.wikipedia.org/wiki/Tzdata (via Python's pytz
> module or the equivalent in your favourite language) to get the local
> time in the timezone for the given date.
>
> Tom
>
> On Sat, May 15, 2010 at 9:34 AM, Greg <[hidden email]> wrote:
>> I wrote too soon. I don't see what I asked for: Time Zone (or local time)
>> given lat, long, and a date-time (GMT) in the past from some service or
>> database. An example: Given -118 long, 34 lat and 2010-02-11 14:12:15 what
>> was the time offset from GMT (or what was the local time then considering
>> daylight savings).
>> I'll continuing searching if no one has a ready answer
>>
>> On May 14, 2010, at 10:45 AM, Jan Martin wrote:
>>
>> There seem to be a lot of ways to do this:
>>
>> http://www.google.de/search?q=timezone+from+latitude+longitude&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:official&client=firefox-a
>>
>> Jan
>>
>> On Fri, May 14, 2010 at 7:22 PM, Greg <[hidden email]> wrote:
>>>
>>> Is there a source for determining local time or offset from GMT from the
>>> coords and time? And by that I mean something accessible from a script. I
>>> want to label the logs for Garmin tracks with the local time (and eventually
>>> location). I wouldn't expect this to be part of GPSBabel, but this is hard
>>> to search for, at least for me.
>>>
>>> Thanks
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Gpsbabel-misc mailing list http://www.gpsbabel.org
>>> [hidden email]
>>> To unsubscribe, change list options, or see archives, visit:
>>> https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc


------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc


------------------------------------------------------------------------------


_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Local Time (zone) from coords and time (OT)

Tom Paton
On Sat, May 15, 2010 at 5:19 PM, John Robert Peterson <[hidden email]> wrote:
> I may be missing something fundemental here -- but the earth tools things
> seems to do exactly what you are after.

I believe the OP is looking for the timezone offset at a given date in
the past, i.e. it must account for Daylight Savings Time.  Just
querying based on Lat/Lon gives you only the offset right now.

Tom

------------------------------------------------------------------------------

_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Local Time (zone) from coords and time (OT)

Greg-110

On May 15, 2010, at 1:53 AM, Tom Paton wrote:

On Sat, May 15, 2010 at 5:19 PM, John Robert Peterson <[hidden email]> wrote:
I may be missing something fundemental here -- but the earth tools things
seems to do exactly what you are after.

I believe the OP is looking for the timezone offset at a given date in
the past, i.e. it must account for Daylight Savings Time.  Just
querying based on Lat/Lon gives you only the offset right now.

That's right. 

I've looked at the zone.tab and it doesn't have DST, only the name of the time zone.

I've found that Ruby has a method for determining status of local DST, which gives me a place to look including other languages.

Time.local(2000, 7, 1).isdst #=> true
   Time.local(2000, 1, 1).isdst   #=> false
   Time.local(2000, 7, 1).dst?    #=> true
   Time.local(2000, 1, 1).dst?    #=> false



------------------------------------------------------------------------------


_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc