# ASP Classic samples

**URL:** <https://discussions.flightaware.com/t/asp-classic-samples/16766>\
**Category:** AeroAPI\
**Created:** [June 1, 2015, 10:58pm UTC](https://discussions.flightaware.com/t/asp-classic-samples/16766 "2015-06-01T22:58:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![donelewis](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@donelewis](https://discussions.flightaware.com/u/donelewis)\
**Post date:** [June 1, 2015, 10:58pm UTC](https://discussions.flightaware.com/t/asp-classic-samples/16766/1 "2015-06-01T22:58:11Z")

</div>

So far I just need some simple functions in classic asp. We got the sample asp to list incoming flights.

We need

1. Status of a flight using flight number and airline code
2. Gate # of the same same flight if arrived
3. Expected arrival time if still in transit.

Thanks

Don  
[myjurny.com](http://myjurny.com)

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [June 1, 2015, 11:23pm UTC](https://discussions.flightaware.com/t/asp-classic-samples/16766/2 "2015-06-01T23:23:03Z")

</div>

1. You will need to write the code to call the “[FlightInfoEx](https://flightaware.com/commercial/flightxml/explorer/#op_FlightInfoEx)” function with the ident that is the airline code (3-character ICAO code) plus the appended flight number. That function will return multiple flight instances (some future, any enroute ones, some past) of that flight number. Your application will need to show that list to the user and allow them to pick which instance (based on the day/time) they want.

2. Then whichever flight instance they picked, use the faFlightID to call the “[AirlineFlightInfo](https://flightaware.com/commercial/flightxml/explorer/#op_AirlineFlightInfo)” function and then you can get the gate #, if it is available.

3. The original result of the FlightInfoEx function has the “estimatedarrivaltime” for each instance of the flight.

Note that the “actualdeparturetime” will be 0 when it has not yet occurred, or non-zero if it has departed. Similarly, “actualarrivaltime” will be 0 when it has not yet arrived, but non-zero if it has. A flight that is enroute will therefore have actualdeparturetime != 0 and actualarrivaltime == 0.

---

<div class="post-metadata">

**Author:** ![donelewis](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@donelewis](https://discussions.flightaware.com/u/donelewis)\
**Post date:** [June 1, 2015, 11:28pm UTC](https://discussions.flightaware.com/t/asp-classic-samples/16766/3 "2015-06-01T23:28:32Z")

</div>

Thanks,getting close. How do I break down the number for the times?

---

<div class="post-metadata">

**Author:** ![donelewis](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@donelewis](https://discussions.flightaware.com/u/donelewis)\
**Post date:** [June 1, 2015, 11:42pm UTC](https://discussions.flightaware.com/t/asp-classic-samples/16766/4 "2015-06-01T23:42:32Z")

</div>

THANKS! We got it working!

---

<div class="post-metadata">

**Author:** ![donelewis](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@donelewis](https://discussions.flightaware.com/u/donelewis)\
**Post date:** [June 1, 2015, 11:46pm UTC](https://discussions.flightaware.com/t/asp-classic-samples/16766/5 "2015-06-01T23:46:30Z")

</div>

How do I breakdown the numbers in departure time?

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [June 2, 2015, 12:19am UTC](https://discussions.flightaware.com/t/asp-classic-samples/16766/6 "2015-06-02T00:19:42Z")

</div>

All timestamps are “UNIX Epoch” seconds since Jan 1, 1970 in UTC timezone, which is a fairly standard computing representation of time. You will need to research what methods exist in ASP to convert and format to different representations.

Based on [this webpage](http://www.epochconverter.com/), I think you might be able to try this to get it in human-readable UTC format:

```auto

 DateAdd("s", epoch, "01/01/1970 00:00:00")

```

---

<div class="post-metadata">

**Author:** ![donelewis](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@donelewis](https://discussions.flightaware.com/u/donelewis)\
**Post date:** [June 2, 2015, 4:26pm UTC](https://discussions.flightaware.com/t/asp-classic-samples/16766/7 "2015-06-02T16:26:59Z")

</div>

Sorry, I got no answer on converting from epoch to human in asp.

I tried dividing epoch by 1000 to remove milliseconds

☹

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [June 2, 2015, 4:32pm UTC](https://discussions.flightaware.com/t/asp-classic-samples/16766/8 "2015-06-02T16:32:48Z")

</div>

Did you try the DateAdd() command I listed above? There is no need to divide by 1000 since they are already whole seconds, not milliseconds.
