- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why do I get different timestamps in python on different machines?
An timestamp is an offset value between a point in time line and the epoch, it's nothing to do with timezone. When it's converted to a human readable string like '%Y-%m-%d %H:%M:%S' that doesn't include any timezone information, python assumes that you want to use local timezone setting.
datetime.timestamp() on a naive datetime object calls mktime() internally i.e., the input is interpreted as the local time. Local time definitions may differ between systems.
C mktime() may return a wrong result if the local timezone had different utc offset in the past and a historical timezone database is not used.
On Unix, when we call timestamp(), the interpreter uses the tz database available on UNIX systems to get the timezone information. While it doesn't have it on windows.
- Why do Passports have different colours ?
- Why do identical twins have different fingerprints?
- Why do I get $Title$ and $END$ on Tomcat?
- Why do humans have different types of teeth?
- Different Operations on Processes
- Python - Drawing different shapes on PyGame window
- Why do I get Internal Server Error 500 in my Python CGI script?
- How do I make bar plots automatically cycle across different colors?
- Select values that meet different conditions on different rows in MySQL?
- Why do we have a different time zones and why GMT is considered as the standard?
- Why do I get premature end of script headers Error in Python CGI script?
- How do I specify different layouts for portrait and landscape orientations in Android?
- How can I plot two different spaced time series on one same plot in Python Matplotlib?
- What are different Navigator properties I can use on my web page?
- Different messages in Tkinter - Python