Last active
February 8, 2019 08:29
-
-
Save deepwilson/7278213d00dfa00792fd1d05d6e5e434 to your computer and use it in GitHub Desktop.
Get current timestamp in IST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python3 | |
from datetime import datetime | |
from pytz import timezone | |
curent_timestamp_ist = int(datetime.now(timezone('Asia/Kolkata')).timestamp()) | |
# Convert to HH:M:SS | |
import time | |
curent_timestamp_ist += 19800 | |
time.strftime("%H:%M:%S", time.gmtime(curent_timestamp_ist)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment