Created
April 9, 2022 11:39
-
-
Save rudSarkar/a6dff1308446d633c3d144305080b57a to your computer and use it in GitHub Desktop.
get local time using pytz and datetime
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
import pytz | |
from datetime import datetime | |
BST = pytz.timezone('Asia/Dhaka') | |
datetime_bst = datetime.now(BST) | |
get_local_time = datetime_bst.strftime('%I:%M%P') | |
# Get more strftime : https://strftime.org/ | |
print(get_local_time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment