-1

Hello Amazing people :)

I am just a 17 year old learning to code so please don't be so hard on me, I want to convert an epoch value which is in the timezone UTC +5:30, I want to convert that time stamp to GMT, (London Time), how can I do that in python?

Thank you so much, you all are amazing people :D

JohnSmith
  • 113
  • 5

1 Answers1

0

The time() function returns the number of seconds passed since epoch.

For Unix system, January 1, 1970, 00:00:00 at UTC is epoch (the point where time begins).

import time
seconds = time.time()
print("Seconds since epoch =", seconds) 

There is no time difference between Coordinated Universal Time and Greenwich Mean Time 7:17 AM Friday, Coordinated Universal Time (UTC) is 7:17 AM Friday, Greenwich Mean Time (GMT)

Key difference: Both UTC and GMT are time standards that differ in terms of their derivation and their use.

According to timeanddate.com:

The Difference Between GMT and UTC:

Greenwich Mean Time (GMT) is often interchanged or confused with Coordinated Universal Time (UTC). But GMT is a time zone and UTC is a time standard.

Although GMT and UTC share the same current time in practice, there is a basic difference between the two:

  • GMT is a time zone officially used in some European and African countries. The time can be displayed using both the 24-hour format (0 - 24) or the 12-hour format (1 - 12 am/pm).
  • UTC is not a time zone, but a time standard that is the basis for civil time and time zones worldwide. This means that no country or territory officially uses UTC as a local time.
Kuldeep Singh Sidhu
  • 3,748
  • 2
  • 12
  • 22