LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timezone given Longitude and Latitude

Solved!
Go to solution

Hi everyone,

 

I am currently working on a project that uses a longitude and latitude to determine what time it is at that point in the world. I have  attached the code as well as a picture of the time zones divided longitudinally. I have a code working that uses strictly longitude, but as you look at the picture, there are some anomalies. 

 

I've had a couple thoughts about potential solutions.

1. Could I upload the image to labview, create a chart in increments of 15 degree by 5 degree boxes, where labview is given a basically x-value (Longitude) and y-value (Latitude) and given the 'coordinates' determine the time zone from there?

 

You do not have to get too deep in detail just want to know some ideas that pop into your head!

Download All
0 Kudos
Message 1 of 8
(2,674 Views)

Well the first thing that pops into my head is:

 

What about all the "odd ball" countries and regions that do not follow UTC +/- hours based solely on longitude.

 

For instance in one "longitude segment" I see three or four different time zones

 

+3:00, +3:30, +4:00 and +5.00

 

A big ol' look-up table is what you are going to need and still it is going to be hard because you really have to determine the country they are in. Because different countries even on the same longitude can still have different time zones.

 

Why not just read the system timezone setting?

TZCapture.PNG

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 8
(2,630 Views)

Also, changes in local time happen a LOT.  I think as recently as last year, or a few years ago, there were places in the United States that changed the time zone they belonged to!  I think some countries adopted daylight saving, while others ditched it.

 

You'd be surprised at how many Windows updates are to update time information for a location.

 

You'll have to be on top of things if you want to be current.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 3 of 8
(2,609 Views)

Yeah it gets pretty tricky. I wish the world could be separated in even chunks! Thanks for your help. I've had a little time to work on it today and basically compiled the longitude and latitudes of 24,000 cities across the world, their country code, and their corresponding timezone. I passed it into labview and now working on searching the 2D array for desired inputs. So that's where I'm at. 

 

But yes, that would make a lot of sense and easier to just do that! But, that wasn't what I was asked to do. I will talk it over with my boss and see how he wants to proceed!

0 Kudos
Message 4 of 8
(2,587 Views)

Thanks for the reply! I definitely would have to be on top of it, the world is a tricky place, eh? Thanks again for your reply, will take it into account. Hope you have a great day.

 

 

0 Kudos
Message 5 of 8
(2,586 Views)

I wonder if there's some official database you can pull this info from?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 8
(2,576 Views)
Solution
Accepted by topic author arosss

@billko wrote:

I wonder if there's some official database you can pull this info from?


Turns out there are...

========================
=== Engineer Ambiguously ===
========================
Message 7 of 8
(2,571 Views)

@RTSLVU wrote:

@billko wrote:

I wonder if there's some official database you can pull this info from?


Turns out there are...


NICE!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 8
(2,552 Views)