UTC time to GPS time converter by Python

Viewed 9866

I have a UTC time (epoch Unix time) formatted as timestamp as below.
1496224620
(Human readable value: May 31, 2017 09:57:00)

I need to convert the timestamp formatted as Unix time into GPS time format as below.
1180259838
(Human readable value: May 31, 2017 09:57:00)

I need a python program (algorithm is fine for me) to convert timestamp formatted as Unix time to timestamp formatted as GPS time.

There is one PHP program to do so. I can change from PHP code to Python code to have a Python program by myself. But I think there is also a short way (built-in function of Python) that can implement my expectation more effective.
Here is the link of PHP program
https://www.andrews.edu/~tzs/timeconv/timealgorithm.html

2 Answers
Related