Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Youtube API reading incorrect times

Has anyone had a situation where the Google API picking up upload time given you a result that isn’t true?

For example: 2023-04-29T21:10:04Z

This is the return from the API for today’s video that was uploaded. The thing is, I’m in Missouri (Central Daylight Time) and it’s currently 20:40. The originator is in Florida so we’re dealing with a 1 hour difference.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This individual releases videos around 3, maybe 5 at most. Technically, when I first ran my code, this video hasn’t been released yet. So it’s adding about 6 hours to the time.

Can I assume it’s using some odd timezone?

>Solution :

The timestamp returned by Google API is in UTC timezone (Denotes with the Z at the back of the string): 2023-04-29T21:10:04Z

After a bit of conversion, this is equivalent to 2023-04-29 16:10:04 of your timezone (CT / UTC-5), which should match your expectation of the "adding 6 hours to the time"

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading