mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 14:01:09 +00:00
Merge pull request #267 from codingis4noobs2/master
Added A New Project (Get_Time_Timezones)
This commit is contained in:
commit
41aa3fc6e9
10
Get_Time_TimezoneWise/README.md
Normal file
10
Get_Time_TimezoneWise/README.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# How To Use:
|
||||||
|
|
||||||
|
First Install pytz Library, If You Have Already Installed It Then You Are Good To Go :)
|
||||||
|
|
||||||
|
Well For Those Who Haven't Installed It, Install It Using:
|
||||||
|
```python
|
||||||
|
pip install pytz
|
||||||
|
```
|
||||||
|
|
||||||
|
Now Simply Run The Program To Fetch Time From All Timezones :)
|
18
Get_Time_TimezoneWise/get_times.py
Normal file
18
Get_Time_TimezoneWise/get_times.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# First Install Using The Command Below:
|
||||||
|
# pip install pytz
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
import pytz
|
||||||
|
|
||||||
|
# list of desired countries
|
||||||
|
Country_Zones = pytz.all_timezones # pytz.all_timezones will create a list with name of all timezones
|
||||||
|
|
||||||
|
country_time_zones = []
|
||||||
|
|
||||||
|
for country_time_zone in Country_Zones:
|
||||||
|
country_time_zones.append(pytz.timezone(country_time_zone))
|
||||||
|
|
||||||
|
for i in range(len(country_time_zones)):
|
||||||
|
country_time = datetime.now(country_time_zones[i])
|
||||||
|
print(f"The date of {Country_Zones[i]} is {country_time.strftime('%d-%m-%y')} and The time of {Country_Zones[i]} is {country_time.strftime('%H:%M:%S')}") #prints current time of all timezones in Country_Zones
|
||||||
|
|
1
Get_Time_TimezoneWise/requirements.txt
Normal file
1
Get_Time_TimezoneWise/requirements.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
pytz
|
|
@ -45,6 +45,7 @@ So far, the following projects have been integrated to this repo:
|
||||||
|[Frammed text generator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/FramedText) | [jcdwalle](https://github.com/jcdwalle)|
|
|[Frammed text generator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/FramedText) | [jcdwalle](https://github.com/jcdwalle)|
|
||||||
|[git_automation](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/git_automation)| [loge1998](https://github.com/loge1998)|
|
|[git_automation](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/git_automation)| [loge1998](https://github.com/loge1998)|
|
||||||
|[Gmail Mailing Script](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/mailing) |[mayank-kapur](https://github.com/kapurm17) |
|
|[Gmail Mailing Script](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/mailing) |[mayank-kapur](https://github.com/kapurm17) |
|
||||||
|
|[Get Time By TimeZone](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Get_Time_TimezoneWise)|[Parth Shah](https://github.com/codingis4noobs) |
|
||||||
|[Handwrting DNN recognizer](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Handwriting_Recognizer) |[Chris]() |
|
|[Handwrting DNN recognizer](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Handwriting_Recognizer) |[Chris]() |
|
||||||
|[HTML Table to List](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/HTML_Table_to_List) | [Nitish Srivastava](https://github.com/nitish-iiitd)|
|
|[HTML Table to List](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/HTML_Table_to_List) | [Nitish Srivastava](https://github.com/nitish-iiitd)|
|
||||||
|[Image circle formatter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image-Circulator) |[Berk Gureken](https://github.com/bureken) |
|
|[Image circle formatter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image-Circulator) |[Berk Gureken](https://github.com/bureken) |
|
||||||
|
|
Loading…
Reference in New Issue
Block a user