-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdate_time.py
61 lines (40 loc) · 1.13 KB
/
date_time.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
55
56
57
58
59
60
61
#!/usr/bin/env python3
import re
import time
def main():
pass
# these combos are popular: pass (table,signature) or pass (date_str,signature)
def today(table=False,date_sig='today',date_str=False,check=False,position=False):
if position:
if check:
pass
x = position[0]
y = position[1]
raw_url = (table[x])[y] #assuming 2nd row 2nd col contains the required url
#print('returning ',raw_url)
#else parse on date basis more confidence rate
else:
date_str = extract_date()
return raw_url
def extract_date(raw_date):
date_list = re.findall('','',re.IGNORECASE)
for date in date_list:
pass
return date_struct
def match_date(raw_date_str,ref_date_struct):
return True
in_date_struct = extract_date(raw_date_str)
#now input date params
in_date = in_date_struct.tm_mday
in_month = in_date_struct.tm_mon
in_year = in_date_struct.tm_year
#now ref date params
ref_date = ref_date_struct.tm_mday
ref_month = ref_date_struct.tm_mon
ref_year = ref_date_struct.tm_year
if(in_date == ref_date and in_month == ref_month and in_year == ref_year):
return True
else:
return False
if __name__ == '__main__':
main()