Created
June 15, 2012 06:37
-
-
Save martin-lukac/2935042 to your computer and use it in GitHub Desktop.
India Timezone pytz possible issue
This file contains hidden or 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
#!/usr/bin/python | |
import pytz | |
from datetime import datetime | |
intz = pytz.timezone('Asia/Kolkata') | |
nowdt = datetime.now(intz) | |
todaydt = datetime(2012,6,15,tzinfo=intz) | |
assert(todaydt.tzinfo == nowdt.tzinfo) | |
print todaydt | |
print nowdt |
Thanks for telling but can I write Delhi or Bangalore or Mumbai in place-off Kolkata
If you can see that specific location Timezone matching your current time
zone you can use that too.
…On Wed, 12 Aug 2020, 8:47 pm Tanay Chaturvedi, ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Thanks for telling but can I write Delhi or Bangalore or Mumbai in
place-off Kolkata
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/2935042#gistcomment-3414587>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APWURDV6YOB4XY757W62S3LSAKXBLANCNFSM4HY5X5CA>
.
Thanks for telling but can I write Delhi or Bangalore or Mumbai in place-off Kolkata
Its the same for any. IST is taken from Kolkata only so No Problem
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import datetime
import pytz
d_month = datetime.datetime.now(tz=pytz.timezone('Asia/Kolkata'))
print(d_month.strftime('%B %d, %Y'))
Hope this will be helpful.