-
Will this code account for return trip falling on March 12, after Daylight Savings Time kicks in? IN other words, first part of the trip is pre daylight savings and return trip will be after daylight savings. SW website mentions 25 hour prior checkin for flights after daylight savings. Please advise. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
That is a good question. The script will subtract 24 hours from the flight date to get the check-in time. The website mentions 25 hours before, but I don't think they are accounting for the hour that is lost on March 12th (bringing it back to 24 hours before), making 4PM the day before actually be 5PM the next day (still 24 hours but we see it as 25). I'm not exactly sure how pytz will handle the timing, but from my testing, it should handle it correctly. The flight times are converted into UTC as soon as possible (there is no daylight savings for UTC), so the timing should still be correct. However, it would be great to test this first by running the script and getting the flight time it outputs (will be in UTC). Then, you can convert that back into the flight's local timezone and verify that it is the same as what is said on the SW website. If it is, the script should sleep for the correct amount of time because of my explanation in the first paragraph. |
Beta Was this translation helpful? Give feedback.
-
I think I understand what you are saying. UTC converted to local time may or may not same on 11th March & 12th March for all SW departure cities. For cities not observing DST (Arizona, Hawaii, Puerto Rico etc.), UTC converted to local time will be same on both 11th March & 12th March. But for most other cities that are observing DST, UTC converted to local time will be different on 11th March and 12th March. The eligible flights that SW website refers to could mean flight originating from cities which observe DST (everywhere in US except Hawaii, Arizona, Puerto Rico etc). But since this program wakes up on UTC, it is immaterial what the local time is. If one is checking-in on SW website, then they must account for DST conversion. But this program should wake up 24 hours UTC prior to departure, and it should be eligible to checkin, regardless of what local time is or whether the departure location observes DST. |
Beta Was this translation helpful? Give feedback.
-
Worked like a charm. |
Beta Was this translation helpful? Give feedback.
That is a good question. The script will subtract 24 hours from the flight date to get the check-in time. The website mentions 25 hours before, but I don't think they are accounting for the hour that is lost on March 12th (bringing it back to 24 hours before), making 4PM the day before actually be 5PM the next day (still 24 hours but we see it as 25).
I'm not exactly sure how pytz will handle the timing, but from my testing, it should handle it correctly. The flight times are converted into UTC as soon as possible (there is no daylight savings for UTC), so the timing should still be correct.
However, it would be great to test this first by running the script and getting the flight time it…