-
-
Save fatosmorina/c1e860ec0dbefba328f4043bfe324ed7 to your computer and use it in GitHub Desktop.
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
from datetime import datetime | |
import pytz | |
timezone_tokyo = pytz.timezone('Asia/Tokyo') | |
tokyo_datetime_obj = datetime.now(timezone_tokyo) | |
timezone_istanbul = pytz.timezone('Europe/Istanbul') | |
istanbul_datetime_obj = tokyo_datetime_obj.astimezone(timezone_istanbul) | |
print('Asia/Tokyo:', tokyo_datetime_obj.time()) # ('Asia/Tokyo:', datetime.time(23, 4, 42, 684766)) | |
print('Europe/Istanbul:', istanbul_datetime_obj.time()) # ('Europe/Istanbul:', datetime.time(17, 4, 42, 684766)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment