473,503 Members | 11,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Time Difference

I am trying to calculate elapsed travel times for flights. My plan is
to enter the local departure time, the departure city and the local
arrival time and city. These times would be standardised to GMT and a
date difference calculated which would be the theoretical elapsed time
of the flight

I have one Table called Cities which has the name of the city and the
difference from GMT eg Sydney is 10 (ie 10 hrs ahead of GMT), LA is -7
ie 7 hours behind GMT.

I then have a second table called flights with data to record the
departure and arrival times (local ) of planned flights, using combo
boxes to choose the arrival and departure cities. I want the data to
calculate the elapsed time. I assume I will need a flight header
table and a flight detailed table to allow me to calculate when more
than one flight is involved but have never used time differential
calculations before so am looking for some basic starting points

Appreciate any help
Steve
Jun 27 '08 #1
3 3424
There are a few issues here, Steve - such as what to store verses what to
display - and the best solution will depend on what you are trying to do
with your data.

An argument could be made for storing everything on the GMT clock, and then
displaying the date/time for the local timezone where appropriate. That
would really simplify any calculations you need to make, e.g. when a pilot
needs a break, when a maintenance needs to be done, which planes are in the
air at the same time, hours travelled, and how long flight times are.

One of the issues is knowing the history of times at the various locations
you must track. Daylight saving adjustments are not consistent throughout
the years (e.g. Sydney was different the year it held the Olympics.) You
therefore need either a table to record all time changes for all locations,
or some way to query that from the OS. (I think I read that Vista has that
history, but XP does not.)

Anyway, if you store everything on GMT, and you know when all the timezones
change, you can interface it to display local time. You can even use some
unbound controls overlaying the calculated local time to allow the user to
enter local times, and convert them to GMT times for storage. Post back if
you need more help on that.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Steve" <st**********@gmail.comwrote in message
news:8c**********************************@f24g2000 prh.googlegroups.com...
>I am trying to calculate elapsed travel times for flights. My plan is
to enter the local departure time, the departure city and the local
arrival time and city. These times would be standardised to GMT and a
date difference calculated which would be the theoretical elapsed time
of the flight

I have one Table called Cities which has the name of the city and the
difference from GMT eg Sydney is 10 (ie 10 hrs ahead of GMT), LA is -7
ie 7 hours behind GMT.

I then have a second table called flights with data to record the
departure and arrival times (local ) of planned flights, using combo
boxes to choose the arrival and departure cities. I want the data to
calculate the elapsed time. I assume I will need a flight header
table and a flight detailed table to allow me to calculate when more
than one flight is involved but have never used time differential
calculations before so am looking for some basic starting points

Appreciate any help
Steve
Jun 27 '08 #2
On Jun 7, 7:19*pm, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
There are a few issues here, Steve - such as what to store verses what to
display - and the best solution will depend on what you are trying to do
with your data.

An argument could be made for storing everything on the GMT clock, and then
displaying the date/time for the local timezone where appropriate. That
would really simplify any calculations you need to make, e.g. when a pilot
needs a break, when a maintenance needs to be done, which planes are in the
air at the same time, hours travelled, and how long flight times are.

One of the issues is knowing the history of times at the various locations
you must track. Daylight saving adjustments are not consistent throughout
the years (e.g. Sydney was different the year it held the Olympics.) You
therefore need either a table to record all time changes for all locations,
or some way to query that from the OS. (I think I read that Vista has that
history, but XP does not.)

Anyway, if you store everything on GMT, and you know when all the timezones
change, you can interface it to display local time. You can even use some
unbound controls overlaying the calculated local time to allow the user to
enter local times, and convert them to GMT times for storage. Post back if
you need more help on that.

--
Allen Browne - Microsoft MVP. *Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Steve" <stevecox4...@gmail.comwrote in message

news:8c**********************************@f24g2000 prh.googlegroups.com...
I am trying to calculate elapsed travel times for flights. *My plan is
to enter the local departure time, the departure city and the local
arrival time and city. *These times would be standardised to GMT and a
date difference calculated which would be the theoretical elapsed time
of the flight
I have one Table called Cities which has the name of the city and the
difference from GMT eg Sydney is 10 (ie 10 hrs ahead of GMT), LA is -7
ie 7 hours behind GMT.
I then have a second table called flights with data to record the
departure and arrival times (local ) of planned flights, using *combo
boxes to choose the arrival and departure cities. *I want the data to
calculate the elapsed time. *I assume I will need a flight header
table and a flight detailed table to allow me to calculate when more
than one flight is involved but have never used time differential
calculations before so am looking for some basic starting points
Appreciate any help
Steve- Hide quoted text -

- Show quoted text -
Allan,
Thanks for the interest
The idea of standardising on GMT was what I was pursuing. I had
thought of the daylight saving time issue but had decided to work the
time difference issue first as I had never done calcs with time and my
initial attempts failed. I'd appreciate any beginners advice there.
My first attempt was to enter local time on a form which also had a
combo for the town and its associated GMT offset, then use the
me.GMTdeparture=dateadd("h",me.cmobodeparture.colu mn(3) plus the
departure time to get a standard time (where column(3) is the GMT
offset. However the specific scripting required lost me and I havent
even thought about changes to a different day that the calculation
could require
Steve
Jun 27 '08 #3
DateAdd() is the right approach.

I imagine you will have fields like this:
TakeOffDT Date/Time take-off as GMT date/time
Duration Number (Long) Duration of flight in minutes.
AircraftID foreign key to a table of aircraft
FromID foreign key to a table of locations
ToID foreign key to a table of locations

The location table would have fields:
LocationID AutoNumber primary key
LocationName Text city name
MinutesOffset Number Number of minutes offset from GMT.

You can now now calculate the local departure time with a calculated field
in a query that uses both tables:
LocalDepartTime: DateAdd("n", [MinutesOffset], [TakeOffDT])

This is a simplified design that doesn't cope with daylight saving, and also
doesn't handle milk-run type flights (where one flight stops at several
destinations.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Steve" <st**********@gmail.comwrote in message:

The idea of standardising on GMT was what I was pursuing. I had
thought of the daylight saving time issue but had decided to work the
time difference issue first as I had never done calcs with time and my
initial attempts failed. I'd appreciate any beginners advice there.
My first attempt was to enter local time on a form which also had a
combo for the town and its associated GMT offset, then use the
me.GMTdeparture=dateadd("h",me.cmobodeparture.colu mn(3) plus
the departure time to get a standard time (where column(3) is the GMT
offset. However the specific scripting required lost me and I havent
even thought about changes to a different day that the calculation
could require
Steve

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9775
by: Jason Reljac | last post by:
Howdy, For a project I am working on right now I need to be able to calculate the time difference between to given times. (For example...The difference between 11:30 am and 1:45pm being 2:15) ...
10
24445
by: Andreas | last post by:
Hi! Is it possible to get a time event at a specific time, for instance eight a'clock? My program is running in the background and is minimized to the tray bar. If not, is there a smooth way...
2
3027
by: Joe User | last post by:
I am looking to calculate the difference between and event time and a sample time of Now. This is the query that I thought would do it, however I'm returning DIFFERENCE values that look the same...
6
3736
by: cournape | last post by:
Hi there, I have some scientific application written in python. There is a good deal of list processing, but also some "simple" computation such as basic linear algebra involved. I would like to...
6
2714
by: Michael Bulatovich | last post by:
I have a very simple db I use for keeping track of hours, tasks, projects, clients etc. It has a form that I use to enter data. Currently the form has a textbox for a field called "start time",...
7
8449
by: Edward Mitchell | last post by:
I have a number of DateTimePicker controls, some set to dates, some set to a format of Time. The controls are all embedded in dialogs. I created the controls by dragging the DateTime picker from...
5
1455
by: Geoff Jones | last post by:
Hi I have question regarding times and dates in a datatable. I have one table with one column having the date e.g.03/09/04, and another column other the time 08:03:05. The other table has one...
3
23734
by: Randall Parker | last post by:
Suppose one has a database of UTC times that are from different dates in the past. The problem with translating those times to a local time is that one does not know for each UTC time whether the...
15
6398
by: student4lifer | last post by:
Hello, I have 2 time fields dynamically generated in format "m/d/y H:m". Could someone show me a good function to calculate the time interval difference in minutes? I played with strtotime() but...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1523
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.