Is Python Safe from the Year 2038 Bug on a 32-bit Raspberry Pi?

0
0
Asked By CleverCoder99 On

I'm working with a 32-bit version of Raspberry Pi OS and I'm curious about the Year 2038 problem. I have this piece of code that converts epoch time to a readable date:

`datetime.fromtimestamp(date_epoch).strftime("%A, %d.%m.%Y")`

I want to know if this will still generate the correct date after the epoch time hits 2,147,483,647, which corresponds to 03:14:07 UTC on January 19, 2038. Is Python 3.11.2 safe to use for this, and are there any specific versions of Python that can handle this issue? Or is it simply not feasible on 32-bit Raspbian OS? I came across some discussions indicating that Python is safe until the year 10,000, but what's the current situation regarding this bug?

2 Answers

Answered By CodeNewbie88 On

Did you consider trying out the code linked in that GitHub issue for consistency? It might give you a better idea of how it performs.

Answered By DebuggingDude13 On

Just change the date in your tests and see what happens! It's really the best way to find out for sure how your code behaves.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.