![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
I'm not sure where to post this, so please re-direct me if there is a
better place. I have a project where I have to determine the correct GMT time offset for the arrive staton of a flight. I'm doing this for a company that deals with airline carriers all over the world. All that I have to work with are the depart station, depart station local time, arrive station, arrive station local time, and the flight effective date (which is the date the flight departs). The GMT data that I work with is in local times per the station. Some thoughts or questions to consider . . . In order to get the correct GMT offset for the arrive station, I have to know the correct date to use. This usually is not a problem, except it can be if a flight crosses over midnight (meaning it will be the next day at the arrival station) and the flight departed the day before time change date. Their current function always gets the GMT based on the effective date of the flight. This is fine for 99% of the time. When a flight crosses midnight and it's around time change dates, the effective date of the flight might need to have a day added to it if the flight crossed over midnight. Any input or direction would be greatly appreciated. |
#2
|
|||
|
|||
![]() In order to get the correct GMT offset for the arrive station, I have to know the correct date to use. Just let your times go past 24:00 and less than 00:00. Then do a check, and add or subtract a day based on the result. For example, starting with 23:00, five hours of flight, and a +2 hour offset, you end up with 30:00 on (say) Tuesday. Then you check to see if the time is 00:00 or =24:00. Since it's +24:00, add a day and take away 24:00. So now we have 06:00 Wednesday. Same idea, if you start out at 03:00 Friday, a two hour flight, and a seven hour offset (the other way) (in the Space Shuttle, presumably!), you end up with -06:00 (six hours below zero). We check to see if this is 00:00, and if so, ADD 24:00 and subtract a day. We h ave 18:00 Thursday. Limit checks like this are common for all date and time conversions (in fact, any modulo arithmetic with carry). You'll need to check to see if the date goes past Sunday (day 7) so it can cycle "back" to Monday (day 1), see if you passed 31 or 30 or 29 or 28 (depending on month and year) so it can cycle back to the first of Next Month, see if we passed December, etc. Jose -- (for Email, make the obvious changes in my address) |
#3
|
|||
|
|||
![]()
"ydm9" wrote in message
om... [...] Their current function always gets the GMT based on the effective date of the flight. This is fine for 99% of the time. When a flight crosses midnight and it's around time change dates, the effective date of the flight might need to have a day added to it if the flight crossed over midnight. Any input or direction would be greatly appreciated. I think your employers should hire a better programmer. If you think the problem you're working on now is hard, wait until you have to deal with a flight that crosses the International Date Line. I'm guessing your head will explode. Pete |
#4
|
|||
|
|||
![]() "Peter Duniho" wrote in message ... "ydm9" wrote in message om... [...] Their current function always gets the GMT based on the effective date of the flight. This is fine for 99% of the time. When a flight crosses midnight and it's around time change dates, the effective date of the flight might need to have a day added to it if the flight crossed over midnight. Any input or direction would be greatly appreciated. I think your employers should hire a better programmer. If you think the problem you're working on now is hard, wait until you have to deal with a flight that crosses the International Date Line. I'm guessing your head will explode. Pete Nice - I was thinking the same thing. |
#5
|
|||
|
|||
![]()
"Peter Duniho" wrote in message
... "ydm9" wrote in message om... [...] Their current function always gets the GMT based on the effective date of the flight. This is fine for 99% of the time. When a flight crosses midnight and it's around time change dates, the effective date of the flight might need to have a day added to it if the flight crossed over midnight. Any input or direction would be greatly appreciated. I think your employers should hire a better programmer. If you think the problem you're working on now is hard, wait until you have to deal with a flight that crosses the International Date Line. I'm guessing your head will explode. That crosses the Date Line overnight. The LA-Auckland flights leave in the evening and arrive in the morning 2 days later. The return flights leave in the evening and arrive that same morning. -- David Brooks |
#6
|
|||
|
|||
![]()
I recall looking at a flight schedule some years ago for a local carrier in
the Samoa area, I believe. They had a late-night inter-island flight that arrived the day before it departed. "David Brooks" wrote in message If you think the problem you're working on now is hard, wait until you have to deal with a flight that crosses the International Date Line. I'm guessing your head will explode. That crosses the Date Line overnight. The LA-Auckland flights leave in the evening and arrive in the morning 2 days later. The return flights leave in the evening and arrive that same morning. -- David Brooks |
#7
|
|||
|
|||
![]() They had a late-night inter-island flight that arrived the day before it departed. Humberto Ecco spun this conceit into a fat novel called The Island of the Day Before. It wasn't very goodl. all the best -- Dan Ford email: (put Cubdriver in subject line) The Warbird's Forum www.warbirdforum.com The Piper Cub Forum www.pipercubforum.com Viva Bush! blog www.vivabush.org |
#8
|
|||
|
|||
![]()
You could fairly easily do that within the continental US.
-- David Brooks "John Gaquin" wrote in message ... I recall looking at a flight schedule some years ago for a local carrier in the Samoa area, I believe. They had a late-night inter-island flight that arrived the day before it departed. "David Brooks" wrote in message If you think the problem you're working on now is hard, wait until you have to deal with a flight that crosses the International Date Line. I'm guessing your head will explode. That crosses the Date Line overnight. The LA-Auckland flights leave in the evening and arrive in the morning 2 days later. The return flights leave in the evening and arrive that same morning. -- David Brooks |
#9
|
|||
|
|||
![]() "David Brooks" wrote in message news:409ac165 You could fairly easily do that within the continental US. Technically, yes. I suppose I should have been more precise. This flight arrived not just "the day before" it departed, but [almost] "a" day before. IIRC it was about a 30 min flight that arrived about 22 or 23 hours before it departed. "John Gaquin" wrote in message ... I recall looking at a flight schedule some years ago for a local carrier in the Samoa area, I believe. They had a late-night inter-island flight that arrived the day before it departed. |
#10
|
|||
|
|||
![]()
Well aware of the IDL. Programming it is the easy part. Knowing what
to program is the problem. Seeing that I have not received the solution lets me know that I am in the majority of dumb folks. "Peter Duniho" wrote in message ... "ydm9" wrote in message om... [...] Their current function always gets the GMT based on the effective date of the flight. This is fine for 99% of the time. When a flight crosses midnight and it's around time change dates, the effective date of the flight might need to have a day added to it if the flight crossed over midnight. Any input or direction would be greatly appreciated. I think your employers should hire a better programmer. If you think the problem you're working on now is hard, wait until you have to deal with a flight that crosses the International Date Line. I'm guessing your head will explode. Pete |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
All Vietnam Veterans Were Awarded The Vietnam Cross of Gallantry | Otis Willie | Naval Aviation | 0 | May 6th 04 06:56 AM |
All Vietnam Veterans Were Awarded The Vietnam Cross of Gallantry | Otis Willie | Naval Aviation | 0 | February 16th 04 04:52 AM |
All Vietnam Veterans Were Awarded The Vietnam Cross of Gallantry | Otis Willie | Military Aviation | 0 | February 16th 04 04:51 AM |
All Vietnam Veterans Were Awarded The Vietnam Cross of Gallantry | Otis Willie | Military Aviation | 0 | December 1st 03 12:07 AM |
Ownership and passengers | Roger Long | Owning | 30 | October 11th 03 02:00 PM |