-
Notifications
You must be signed in to change notification settings - Fork 0
/
timeanddate.py
54 lines (39 loc) · 1.35 KB
/
timeanddate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from config import *
from speak import *
from geopy.geocoders import Nominatim
from geopy.geocoders import get_geocoder_for_service
get_geocoder_for_service("nominatim")
def get_timezone(location):
# g=Nominatim()
# place, (lat, lng) = g.geocode('New York')
# print(place)
# print('working')
# print(location)
# gc = self.gmclient().geocode(address)
# loc = gc[0]['geometry']['location']
# result = self.gmclient().timezone(location=loc)
# return result
def parseQuestion(string):
# input='new york'
# get_timezone(input)
# timezone = pytz.timezone('Asia/Kolkata')
# timeAndDate = datetime.now(timezone)
# timeandDate.strftime('%Y:%m:%d %H:%M:%S %Z %z')
# ending = 'th'
# if int(dateNumber)==1:
# ending = 'st'
# if int(dateNumber)==2:
# ending = 'nd'
# if int(dateNumber)==3:
# ending = 'rd'
# if 'time' in string:
# if int(minute) == 0:
# speakText("It is "+hour+" o'clock "+ampm)
# if int(minute) < 10:
# speakText("It is "+hour+':'+minute+' '+ampm)
# else:
# speakText("It is "+hour+':'+minute+' '+ampm)
# if 'day' in string:
# speakText("Today is "+day+', '+month+' '+dateNumber+ending+' '+year)
# if 'date' in string:
# speakText("Today is "+month+' '+dateNumber+'th '+year)